| 1 |
namespace { |
| 2 |
template <int V> struct J { static constexpr int value = V; }; |
| 3 |
template <bool V> using K = J<V>; |
| 4 |
using M = K<true>; |
| 5 |
template <int> struct L { template <typename _Tp, typename> using type = _Tp; }; |
| 6 |
template <bool _Cond, typename _If, typename _Else> using N = typename L<_Cond>::type<_If, _Else>; |
| 7 |
M k; |
| 8 |
template <typename _Tp> struct O { using type = _Tp; }; |
| 9 |
template <typename _Up> |
| 10 |
struct P : N<M ::value, O<_Up>, _Up> {}; |
| 11 |
template <typename _Tp> struct Q { using type = typename P<_Tp>::type; }; |
| 12 |
} |
| 13 |
namespace R { |
| 14 |
struct H; |
| 15 |
enum G {}; |
| 16 |
template <typename> class S; |
| 17 |
struct T { using U = bool (*) (H &, const H &, G); U F; }; |
| 18 |
template <typename, typename> class B; |
| 19 |
template <typename _R, typename _F, typename... _A> |
| 20 |
struct B<_R(_A...), _F> { |
| 21 |
static bool F(H &, const H &, G) { return false; } |
| 22 |
__attribute__((noipa)) static _R bar(const H &) {} |
| 23 |
}; |
| 24 |
template <typename _R, typename... _A> |
| 25 |
struct S<_R(_A...)> : T { |
| 26 |
template <typename _F> using AH = B<_R(), _F>; |
| 27 |
template <typename _F> S(_F) { |
| 28 |
using AG = AH<_F>; |
| 29 |
barr = AG::bar; |
| 30 |
F = AG::F; |
| 31 |
} |
| 32 |
using AF = _R (*)(const H &); |
| 33 |
AF barr; |
| 34 |
}; |
| 35 |
template <typename> class I; |
| 36 |
template <typename _F, typename... _B> |
| 37 |
struct I<_F(_B...)> {}; |
| 38 |
template <typename> using W = decltype(k); |
| 39 |
template <int, typename _F, typename... _B> struct V { |
| 40 |
typedef I<typename Q<_F>::type(typename Q<_B>::type...)> type; |
| 41 |
}; |
| 42 |
template <typename _F, typename... _B> |
| 43 |
__attribute__((noipa)) typename V<W<_F>::value, _F, _B...>::type |
| 44 |
baz(_F, _B...) { return typename V<W<_F>::value, _F, _B...>::type (); } |
| 45 |
template <typename _Tp> struct AJ { |
| 46 |
template <typename _Up> struct _Ptr { using type = _Up *; }; |
| 47 |
using AI = typename _Ptr<_Tp>::type; |
| 48 |
}; |
| 49 |
template <typename _Tp> struct Y { |
| 50 |
using AI = typename AJ<_Tp>::AI; |
| 51 |
AI operator->(); |
| 52 |
}; |
| 53 |
} |
| 54 |
extern int z; |
| 55 |
namespace N1 { |
| 56 |
namespace N2 { |
| 57 |
namespace N3 { |
| 58 |
enum Z { Z1, Z2 }; |
| 59 |
template <int> struct X { |
| 60 |
template <typename _F> |
| 61 |
__attribute__((noipa)) void boo(long long, long long, long long, _F &) {} |
| 62 |
}; |
| 63 |
struct AC { |
| 64 |
AC(int); |
| 65 |
void m1(R::S<void()>); |
| 66 |
}; |
| 67 |
template <typename> |
| 68 |
__attribute__((noipa)) void garply(void *, long long, long long, long long) {} |
| 69 |
template <> |
| 70 |
template <typename _F> |
| 71 |
void X<Z2>::boo(long long, long long x, long long y, _F &fi) { |
| 72 |
AC pool(z); |
| 73 |
for (;;) { |
| 74 |
auto job = R::baz(garply<_F>, &fi, y, y, x); |
| 75 |
pool.m1(job); |
| 76 |
} |
| 77 |
} |
| 78 |
struct AB { |
| 79 |
static AB &bleh(); |
| 80 |
template <typename _F> |
| 81 |
void boo(long first, long x, long y, _F fi) { |
| 82 |
switch (ab1) { |
| 83 |
case Z1: |
| 84 |
ab2->boo(first, x, y, fi); |
| 85 |
case Z2: |
| 86 |
ab3->boo(first, x, y, fi); |
| 87 |
} |
| 88 |
} |
| 89 |
Z ab1; |
| 90 |
R::Y<X<Z1>> ab2; |
| 91 |
R::Y<X<Z2>> ab3; |
| 92 |
}; |
| 93 |
template <typename, bool> struct C; |
| 94 |
template <typename _F> struct C<_F, false> { |
| 95 |
__attribute__((noipa)) C(_F) {} |
| 96 |
void boo(long first, long x, long y) { |
| 97 |
auto u = AB::bleh(); |
| 98 |
u.boo(first, x, y, *this); |
| 99 |
} |
| 100 |
}; |
| 101 |
template <typename _F> struct AA { typedef C<_F, 0> type; }; |
| 102 |
} |
| 103 |
} |
| 104 |
} |
| 105 |
struct AD { |
| 106 |
template <typename _F> |
| 107 |
static void boo(long first, long x, long y, _F f) { |
| 108 |
typename N1::N2::N3::AA<_F>::type fi(f); |
| 109 |
fi.boo(first, x, y); |
| 110 |
} |
| 111 |
template <typename _F> |
| 112 |
static void boo(long first, long x, _F f) { |
| 113 |
boo(first, x, 0, f); |
| 114 |
} |
| 115 |
}; |
| 116 |
template <typename> struct A { |
| 117 |
void foo(long long, long long); |
| 118 |
int *c; |
| 119 |
}; |
| 120 |
namespace { |
| 121 |
template <typename> struct D { __attribute__((noipa)) D(int *) {} }; |
| 122 |
} |
| 123 |
template <typename T> |
| 124 |
void A<T>::foo(long long x, long long y) |
| 125 |
{ |
| 126 |
int e; |
| 127 |
D<T> d(&e); |
| 128 |
AD::boo(0, y, d); |
| 129 |
long p; |
| 130 |
for (p = 0; p < x; p++) |
| 131 |
c[p] = c[p - 1]; |
| 132 |
} |