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AgICAgICAgICAgICAgICAgICAgICAgICAgICBJMkNfRlVOQ19TTUJVU19CWVRFX0RBVEEgfCBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSTJDX0ZVTkNfU01CVVNfV09SRF9EQVRBIHwgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkyQ19GVU5DX1NNQlVTX1BST0NfQ0FMTCB8IFwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJMkNfRlVOQ19TTUJVU19XUklURV9CTE9DS19EQVRBIHwgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkyQ19GVU5DX1NNQlVTX1dSSVRFX0JMT0NLX0RBVEFfUEVDIHwgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkyQ19GVU5DX1NNQlVTX0kyQ19CTE9DSykKCi8qIAogKiBEYXRhIGZvciBTTUJ1cyBNZXNzYWdlcyAKICovCiNkZWZpbmUgSTJDX1NNQlVTX0JMT0NLX01BWAkzMgkvKiBBcyBzcGVjaWZpZWQgaW4gU01CdXMgc3RhbmRhcmQgKi8JCiNkZWZpbmUgSTJDX1NNQlVTX0kyQ19CTE9DS19NQVgJMzIJLyogTm90IHNwZWNpZmllZCBidXQgd2UgdXNlIHNhbWUgc3RydWN0dXJlICovCnVuaW9uIGkyY19zbWJ1c19kYXRhIHsKCV9fdTggYnl0ZTsKCV9fdTE2IHdvcmQ7CglfX3U4IGJsb2NrW0kyQ19TTUJVU19CTE9DS19NQVggKyAzXTsgLyogYmxvY2tbMF0gaXMgdXNlZCBmb3IgbGVuZ3RoICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb25lIG1vcmUgZm9yIHJlYWQgbGVuZ3RoIGluIGJsb2NrIHByb2Nlc3MgY2FsbCAqLwoJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbmQgb25lIG1vcmUgZm9yIFBFQyAqLwp9OwoKLyogc21idXNfYWNjZXNzIHJlYWQgb3Igd3JpdGU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