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KioqKioqKioqKioqKioqKg0KICogILKozNjCytequ6/Xqru7uq/K/Q0KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0Kc3RhdGljIGludCBjb252YmF1ZCh1bnNpZ25lZCBsb25nIGludCBiYXVkcmF0ZSkNCnsNCiAgICAgICAgIHN3aXRjaCAoYmF1ZHJhdGUpDQogICAgICAgICB7DQogICAgICAgICAgICBjYXNlIDI0MDA6DQogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjI0MDA7DQogICAgICAgICAgICBjYXNlIDQ4MDA6DQogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjQ4MDA7DQogICAgICAgICAgICBjYXNlIDk2MDA6DQogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjk2MDA7DQogICAgICAgICAgICBjYXNlIDE5MjAwOg0KICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEIxOTIwMDsNCiAgICAgICAgICAgIGNhc2UgMzg0MDA6DQogICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjM4NDAwOw0KICAgICAgICAgICAgY2FzZSA1NzYwMDoNCiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCNTc2MDA7DQogICAgICAgICAgICBjYXNlIDExNTIwMDoNCiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCMTE1MjAwOw0KICAgICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCOTYwMDsNCiAgICAgICAgIH0NCn0NCg0KI2lmbmRlZiBURVNUX0NDQVBQDQppbnQgekNjX0NsZWFuQ0NNU0coKQ0Kew0KICAgICAgICAgaW50IHJldCA9IC0xOw0KICAgICAgICAgLy9nZXQgQ0MgZmQNCiAgICAgICAgIGludCBmZCA9IHpDY0FwcF9HZXRBdENDRmQoKTsNCiAgICAgICAgIGZkX3NldCByZWFkZmRGb3JDQzsNCiAgICAgICAgIA0KICAgICAgICBzdHJ1Y3QgdGltZXZhbCB0dj17MH07ICAgDQoNCiAgICAgICAgIHdoaWxlKDEpDQogICAgICAgICB7DQogICAgICAgICAgICAvLzBzIHRpbWVvdXQNCiAgICAgICAgICAgIHR2LnR2X3NlYyA9IDA7DQogICAgICAgICAgICBGRF9aRVJPKCZyZWFkZmRGb3JDQyk7DQogICAgICAgICAgICBGRF9TRVQoZmQsICZyZWFkZmRGb3JDQyk7ICAgICAgICAgICAgDQogICAgICAgICAgICByZXQgPSBzZWxlY3QoZmQgKyAxLCAmcmVhZGZkRm9yQ0MsIE5VTEwsIE5VTEwsICZ0dik7DQogICAgICAgICAgICBpZihyZXQ8MCkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgLy8iU2VsZWN0IHRpbWVvdXQiDQogICAgICAgICAgICBpZihyZXQgPT0gMCkgICAgICAgICAgDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIA0KICAgICAgICAgICAgaWYoRkRfSVNTRVQoZmQsICZyZWFkZmRGb3JDQykpICAgICAgICAgDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICBjaGFyIEF0QnVmW1pDQ19BUFBfQVRfQlVGX01BWF9MRU5dID0gezB9Ow0KICAgICAgICAgICAgICAgICAgICAgaW50IHJlYWRsZW4gPSAwOw0KICAgICAgICAgICAgICAgICAgICAgcmVhZGxlbiA9IHJlYWQoZmQsIEF0QnVmLCBaQ0NfQVBQX0FUX0JVRl9NQVhfTEVOKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGVsc2UNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgfQ0KICAgICAgICAgDQogICAgICAgICByZXR1cm4gMDsNCn0NCg0KaW50IHpDY0FwcF9HZXRBdENtZEZkKHZvaWQp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YXBwZW5kKF9fRklMRV9fLCBfX0xJTkVfXywgInp0ZV9jY2FwcC5sb2ciLCIlcyB6Q2NBcHBfUG9ydFNlbmQgZmFpbCBmZGNvbT0lZCxkYXRhPSVzLGxlbj0lZFxuICA8LS0tXG4iLF9fRlVOQ1RJT05fXyxmZGNvbSxkYXRhLGRhdGFsZW4pOw0KICAgICAgICB0Y2ZsdXNoKGZkY29tLCBUQ09GTFVTSCk7DQogICAgICAgIHJldHVybiAtMTsNCiAgICB9DQp9DQoNCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQogKiAgcmVjZWl2ZSBkYXRhDQogKiAgt7W72Mq1vMq2wcjrtcTX1r3ayv0NCiAqDQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQppbnQgekNjQXBwX1BvcnRSZWN2KGludCBmZGNvbSwgQ0hBUiAqZGF0YSwgaW50IGRhdGFsZW4pDQp7DQogICAgDQogICAgY2hhciBBdEJ1ZltaQ0NfQVBQX0FUX0JVRl9NQVhfTEVOXSA9IHswfTsNCiAgICBpbnQgcmVhZGxlbiA9IDA7DQogICAgcmVhZGxlbiA9IHJlYWQoZmRjb20sIEF0QnVmLCBaQ0NfQVBQX0FUX0JVRl9NQVhfTEVOKTsNCglpZiAocmVhZGxlbiA+PSAwKSB7IC8vY292IG0NCgkJc3RybmNweShkYXRhLEF0QnVmLHJlYWRsZW4pOw0KCX0NCgkgICAgDQogICAgcmV0dXJuIHJlYWRsZW47DQp9DQoNCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQogKiAgU2V0dXAgY29tbSBhdHRyDQogKiAgZmRjb206ILSuv9rOxLz+w+jK9rf7LCBwcG9ydGluZm86ILT9yejWw7XEtsu/2tDFz6JzDQogKg0KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KaW50IHpDY0FwcF9Qb3J0U2V0KGludCBmZGNvbSw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vdyBjb250cm9sDQogICAgZmN0bCA9IHBQb3J0aW5mby0+ZmN0bDsNCiAgICBzd2l0Y2ggKGZjdGwpDQogICAgew0KICAgICAgICBjYXNlICcwJzoNCiAgICAgICAgew0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyAmPSB+Q1JUU0NUUzsgICAgICAgIC8vbm8gZmxvdyBjb250cm9sDQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgfQ0KICAgICAgICBjYXNlICcxJzoNCiAgICAgICAgew0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBDUlRTQ1RTOyAgICAgICAgIC8vaGFyZHdhcmUgZmxvdyBjb250cm9sDQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgfQ0KICAgICAgICBjYXNlICcyJzoNCiAgICAgICAgew0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19pZmxhZyB8PSBJWE9OIHwgSVhPRkYgfCBJWEFOWTsgICAgLy9zb2Z0d2FyZSBmbG93IGNvbnRyb2wNCiAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQogICAgICAgIGRlZmF1bHQ6DQogICAgICAgIHsNCiAgICAgICAgICAgIC8vWlRFX0xPRyhMT0dfRVJSLCAiVW5rbm93biBmY3RsICVjXG4iLCBmY3RsKTsNCiAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQogICAgfQ0KICAgIA0KICAgIC8vv9jWxsSjyr0sIGRhdGEgYml0cw0KICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgJj0gfkNTSVpFOyAgICAgIC8vv9jWxsSjyr0sIMbBsc7X1rf7tPPQoc67DQogICAgZGF0YWJpdCA9IHBQb3J0aW5mby0+ZGF0YWJpdDsNCiAgICBzd2l0Y2ggKGRhdGFiaXQpDQogICAgew0KICAgICAgICBjYXNlICc1JzoNCiAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gQ1M1Ow0KICAgICAgICAgICAgLy9saW50IC1mYWxsdGhyb3VnaA0KICAgICAgICBjYXNlICc2JzoNCiAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gQ1M2Ow0KICAgICAgICAgICAgLy9saW50IC1mYWxsdGhyb3VnaA0KICAgICAgICBjYXNlICc3JzoNCiAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gQ1M3Ow0KICAgICAgICAgICAgLy9saW50IC1mYWxsdGhyb3VnaA0KICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBDUzg7DQogICAgfQ0KICAgIA0KICAgIC8vv9jWxsSjyr0gcGFyaXR5IGNoZWNrDQogICAgcGFyaXR5ID0gcFBvcnRpbmZvLT5wYXJpdHk7DQogICAgc3dpdGNoIChwYXJpdHkpDQogICAgew0KICAgICAgICBjYXNlICcwJzoNCiAgICAgICAgew0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyAmPSB+UEFSRU5COyAgICAgLy9ubyBwYXJpdHkgY2hlY2sNCiAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQogICAgICAgIGNhc2UgJzEnOg0KICAgICAgICB7DQogICAgICAgICAgICB0ZXJtaW9zX25ldy5jX2NmbGFnIHw9IFBBUkVOQjsgICAgICAvL29kZCBjaGVjaw0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyAmPSB+UEFST0REOw0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIH0NCiAgICAgICAgY2FzZSAnMic6DQogICAgICAgIHsNCiAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gUEFSRU5COyAgICAgIC8vZXZlbiBjaGVjaw0KICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBQQVJPREQ7DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgfQ0KICAgICAgICBkZWZhdWx0Og0KICAgICAgICB7DQogICAgICAgICAgIC8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