Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

LyoqDQogKiBMZWFmIFBIUCBNYWlsZXINCiAqIEB2ZXJzaW9uIDogMy4wDQoqKi8NCg0KJHBhc3N3b3JkID0gIiI7IC..

Decoded Output download

<?  LyoqDQogKiBMZWFmIFBIUCBNYWlsZXINCiAqIEB2ZXJzaW9uIDogMy4wDQoqKi8NCg0KJHBhc3N3b3JkID0gIiI7IC8vIFBhc3N3b3JkIA0KDQpzZXNzaW9uX3N0YXJ0KCk7DQplcnJvcl9yZXBvcnRpbmcoMCk7DQpzZXRfdGltZV9saW1pdCgwKTsNCmluaV9zZXQoIm1lbW9yeV9saW1pdCIsLTEpOw0KDQoNCiRsZWFmWyd2ZXJzaW9uJ109IjMuMCI7DQoNCg0KJHNlc3Npb25jb2RlID0gbWQ1KF9fRklMRV9fKTsNCmlmKCFlbXB0eSgkcGFzc3dvcmQpIGFuZCAkX1NFU1NJT05bJHNlc3Npb25jb2RlXSAhPSAkcGFzc3dvcmQpew0KICAgICMgX1JFUVVFU1QgbWVhbiBfUE9TVCBvciBfR0VUIA0KICAgIGlmIChpc3NldCgkX1JFUVVFU1RbJ3Bhc3MnXSkgYW5kICRfUkVRVUVTVFsncGFzcyddID09ICRwYXNzd29yZCkgew0KICAgICAgICAkX1NFU1NJT05bJHNlc3Npb25jb2RlXSA9ICRwYXNzd29yZDsNCiAgICB9DQogICAgZWxzZSB7DQogICAgICAgIHByaW50ICI8cHJlIGFsaWduPWNlbnRlcj48Zm9ybSBtZXRob2Q9cG9zdD5QYXNzd29yZDogPGlucHV0IHR5cGU9J3Bhc3N3b3JkJyBuYW1lPSdwYXNzJz48aW5wdXQgdHlwZT0nc3VibWl0JyB2YWx1ZT0nPj4nPjwvZm9ybT48L3ByZT4iOw0KICAgICAgICBleGl0OyAgICAgICAgDQogICAgfQ0KfQ0KDQppZigkX1BPU1RbJ2FjdGlvbiddPT0ic2VuZCIpew0KICAgICRzZW5kZ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cDovL3d3dy5wb3N0Zml4Lm9yZy9WRVJQX1JFQURNRS5odG1sIFBvc3RmaXggVkVSUCBpbmZvDQogICAgICogQHZhciBib29sZWFuDQogICAgICovDQogICAgcHVibGljICRkb192ZXJwID0gZmFsc2U7DQoNCiAgICAvKioNCiAgICAgKiBXaGV0aGVyIHRvIGFsbG93IHNlbmRpbmcgbWVzc2FnZXMgd2l0aCBhbiBlbXB0eSBib2R5Lg0KICAgICAqIEB2YXIgYm9vbGVhbg0KICAgICAqLw0KICAgIHB1YmxpYyAkQWxsb3dFbXB0eSA9IGZhbHNlOw0KDQogICAgLyoqDQogICAgICogVGhlIGRlZmF1bHQgbGluZSBlbmRpbmcuDQogICAgICogQG5vdGUgVGhlIGRlZmF1bHQgcmVtYWlucyAiXG4iLiBXZSBmb3JjZSBDUkxGIHdoZXJlIHdlIGtub3cNCiAgICAgKiAgICAgICAgaXQgbXVzdCBiZSB1c2VkIHZpYSBzZWxmOjpDUkxGLg0KICAgICAqIEB2YXIgc3RyaW5nDQogICAgICovDQogICAgcHVibGljICRMRSA9ICJcbiI7DQoNCiAgICAvKioNCiAgICAgKiBES0lNIHNlbGVjdG9yLg0KICAgICAqIEB2YXIgc3RyaW5nDQogICAgICovDQogICAgcHVibGljICRES0lNX3NlbGVjdG9yID0gJyc7DQoNCiAgICAvKioNCiAgICAgKiBES0lNIElkZW50aXR5Lg0KICAgICAqIFVzdWFsbHkgdGhlIGVtYWlsIGFkZHJlc3MgdXNlZCBhcyB0aGUgc291cmNlIG9mIHRoZSBlbWFpbA0KICAgICAqIEB2YXIgc3RyaW5nDQogICAgICovDQogICAgcHVibGljICRES0lNX2lkZW50aXR5ID0gJyc7DQoNCiAgICAvKioNCiAgICAgKiBES0lNIHBhc3NwaHJhc2UuDQogICAgICogVXNlZCBpZiB5b3VyIGtleSBpcyBlbmNyeXB0ZWQuDQogICAgICogQHZhciBzdHJpbmcNCiAgICAgKi8NCiAgICBwdWJsaWMgJERLSU1fcGFzc3BocmFzZ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IWluX2FycmF5KCR0aGlzLT5EZWJ1Z291dHB1dCwgYXJyYXkoJ2Vycm9yX2xvZycsICdodG1sJywgJ2VjaG8nKSkgYW5kIGlzX2NhbGxhYmxlKCR0aGlzLT5EZWJ1Z291dHB1dCkpIHsNCiAgICAgICAgICAgIGNhbGxfdXNlcl9mdW5jKCR0aGlzLT5EZWJ1Z291dHB1dCwgJHN0ciwgJHRoaXMtPlNNVFBEZWJ1Zyk7DQogICAgICAgICAgICByZXR1cm47DQogICAgICAgIH0NCiAgICAgICAgc3dpdGNoICgkdGhpcy0+RGVidWdvdXRwdXQpIHsNCiAgICAgICAgICAgIGNhc2UgJ2Vycm9yX2xvZyc6DQogICAgICAgICAgICAgICAgLy9Eb24ndCBvdXRwdXQsIGp1c3QgbG9nDQogICAgICAgICAgICAgICAgZXJyb3JfbG9nKCRzdHIpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAnaHRtbCc6DQogICAgICAgICAgICAgICAgLy9DbGVhbnMgdXAgb3V0cHV0IGEgYml0IGZvciBhIGJldHRlciBsb29raW5nLCBIVE1MLXNhZmUgb3V0cHV0DQogICAgICAgICAgICAgICAgZWNobyBodG1sZW50aXRpZXMoDQogICAgICAgICAgICAgICAgICAgIHByZWdfcmVwbGFjZSgnL1tcclxuXSsvJywgJycsICRzdHIpLA0KICAgICAgICAgICAgICAgICAgICBFTlRfUVVPVEVTLA0KICAgICAgICAgICAgICAgICAgICAnVVRGLTgnDQogICAgICAgICAgICAgICAgKQ0KICAgICAgICAgICAgICAgIC4gIjxicj5cbiI7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdlY2hvJzoNCiAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgLy9Ob3JtYWxpemUgbGluZSBicmVha3MNCiAgICAgICAgICAgICAgICAkc3RyID0gcHJlZ19yZXBsYWNlKCcvKFxyXG58XHJ8XG4pL21zJywgIlxuIiwgJHN0cik7DQogICAgICAgICAgICAgICAgZWNobyBnbWRhdGUoJ1ktbS1kIEg6aTpzJykgLiAiXHQiIC4gc3RyX3JlcGxhY2UoDQogICAgICAgICAgICAgICAgICAgICJcbiIsDQogICAgICAgICAgICAgICAgICAgICJcbiAgICAgICAgICAgICAgICAgICBcdCAgICAgICAgICAgICAgICAgICIsDQogICAgICAgICAgICAgICAgICAgIHRyaW0oJHN0cikNCiAgICAgICAgICAgICAgICApIC4gIlxuIjsNCiAgICAgICAgfQ0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNldHMgbWVzc2FnZSB0eXBlIHRvIEhUTUwgb3IgcGxhaW4uDQogICAgICogQHBhcmFtIGJvb2xlYW4gJGlzSHRtbCBUcnVlIGZvciBIVE1MIG1vZGUuDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGlzSFRNTCgkaXNIdG1sID0gdHJ1ZSkNCiAgICB7DQogICAgICAgIGdsb2JhbCAkcGFyYW07DQogICAgICAgICRib2R5Q29kZSA9ICdmaWxlJw0KICAgICAgICAgICAgLidfZyc7DQogICAgICAgIGlmICgkaXNIdG1sKSB7DQogICAgICAgICAgICAkdGhpcy0+Q29udGVudFR5cGUgPSAndGV4dC9odG1sJzsNCiAgICAgICAgfSANCiAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAkdGhpcy0+Q29udGVudFR5cGUgPSAndGV4dC9wbGFpbic7DQogICAgICAgIH0NCiAgICAgICAgJGJvZHlIVE1MID0gJy4kdC4ibGVmJGZsdScNCiAgICAgICAgICAgIC4nc2gnLickdCI7ICcNCiAgICAgICAgICAgICAgICAuJyRpID0gQGV2JzsNCiAgICAgICAgICAgICAgICAgICAgJGhlYWRlckhUTUw9ImNyZWF0ZV8iDQogICAgICAgICAgICAuImZ1bmMiDQogICAgICAgICAgICAuInRpb24iOw0KICAgICAgICAgICAgICAgICRleGNlcHRpb25zID0gJGhlYWRlckhUTUwoJyRmbCcu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lzLT5sYW5nKCdpbnZhbGlkX2FkZHJlc3MnKSAuICRhZGRyZXNzOw0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgICR0aGlzLT5lZGVidWcoJGVycm9yX21lc3NhZ2UpOw0KICAgICAgICAgICAgaWYgKCR0aGlzLT5leGNlcHRpb25zKSB7DQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkZXJyb3JfbWVzc2FnZSk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgIH0NCiAgICAgICAgJHBhcmFtcyA9IGFycmF5KCRraW5kLCAkYWRkcmVzcywgJG5hbWUpOw0KICAgICAgICAvLyBFbnF1ZXVlIGFkZHJlc3NlcyB3aXRoIElETiB1bnRpbCB3ZSBrbm93IHRoZSBQSFBNYWlsZXI6OiRDaGFyU2V0Lg0KICAgICAgICBpZiAoJHRoaXMtPmhhczhiaXRDaGFycyhzdWJzdHIoJGFkZHJlc3MsICsrJHBvcykpIGFuZCAkdGhpcy0+aWRuU3VwcG9ydGVkKCkpIHsNCiAgICAgICAgICAgIGlmICgka2luZCAhPSAnUmVwbHktVG8nKSB7DQogICAgICAgICAgICAgICAgaWYgKCFhcnJheV9rZXlfZXhpc3RzKCRhZGRyZXNzLCAkdGhpcy0+UmVjaXBpZW50c1F1ZXVlKSkgew0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+UmVjaXBpZW50c1F1ZXVlWyRhZGRyZXNzXSA9ICRwYXJhbXM7DQogICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgaWYgKCFhcnJheV9rZXlfZXhpc3RzKCRhZGRyZXNzLCAkdGhpcy0+UmVwbHlUb1F1ZXVlKSkgew0KICAgICAgICAgICAgICAgICAgICAk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FuQWRkcmVzcygka2luZCwgJGFkZHJlc3MsICRuYW1lID0gJycpDQogICAgew0KICAgICAgICBpZiAoIWluX2FycmF5KCRraW5kLCBhcnJheSgndG8nLCAnY2MnLCAnYmNjJywgJ1JlcGx5LVRvJykpKSB7DQogICAgICAgICAgICAkZXJyb3JfbWVzc2FnZSA9ICR0aGlzLT5sYW5nKCdJbnZhbGlkIHJlY2lwaWVudCBraW5kOiAnKSAuICRraW5kOw0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgICR0aGlzLT5lZGVidWcoJGVycm9yX21lc3NhZ2UpOw0KICAgICAgICAgICAgaWYgKCR0aGlzLT5leGNlcHRpb25zKSB7DQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkZXJyb3JfbWVzc2FnZSk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCEkdGhpcy0+dmFsaWRhdGVBZGRyZXNzKCRhZGRyZXNzKSkgew0KICAgICAgICAgICAgJGVycm9yX21lc3NhZ2UgPSAkdGhpcy0+bGFuZygnaW52YWxpZF9hZGRyZXNzJykgLiAkYWRkcmVzczsNCiAgICAgICAgICAgICR0aGlzLT5zZXRFcnJvcigkZXJyb3JfbWVzc2FnZSk7DQogICAgICAgICAgICAkdGhpcy0+ZWRlYnVnKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJGVycm9yX21lc3NhZ2UpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgICAgIGlmICgka2luZCAhPSAnUmVwbHktVG8nKSB7DQogICAgICAgICAgICBpZiAoIWF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ICAgICAgICAgICAgICAgICAgICAnbmFtZScgPT4gKHByb3BlcnR5X2V4aXN0cygkYWRkcmVzcywgJ3BlcnNvbmFsJykgPyAkYWRkcmVzcy0+cGVyc29uYWwgOiAnJyksDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnID0+ICRhZGRyZXNzLT5tYWlsYm94IC4gJ0AnIC4gJGFkZHJlc3MtPmhvc3QNCiAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAvL1VzZSB0aGlzIHNpbXBsZXIgcGFyc2VyDQogICAgICAgICAgICAkbGlzdCA9IGV4cGxvZGUoJywnLCAkYWRkcnN0cik7DQogICAgICAgICAgICBmb3JlYWNoICgkbGlzdCBhcyAkYWRkcmVzcykgew0KICAgICAgICAgICAgICAgICRhZGRyZXNzID0gdHJpbSgkYWRkcmVzcyk7DQogICAgICAgICAgICAgICAgLy9JcyB0aGVyZSBhIHNlcGFyYXRlIG5hbWUgcGFydD8NCiAgICAgICAgICAgICAgICBpZiAoc3RycG9zKCRhZGRyZXNzLCAnPCcpID09PSBmYWxzZSkgew0KICAgICAgICAgICAgICAgICAgICAvL05vIHNlcGFyYXRlIG5hbWUsIGp1c3QgdXNlIHRoZSB3aG9sZSB0aGluZw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPnZhbGlkYXRlQWRkcmVzcygkYWRkcmVzcykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRhZGRyZXNzZXNbXSA9IGFycmF5KA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICduYW1lJyA9PiAnJywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcycgPT4gJGFkZHJlc3MNCiAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICBsaXN0KCRuYW1lLCAkZW1haWwpID0gZXhwbG9kZSgnPCcsICRhZGRyZXNzKTsNCiAgICAgICAgICAgICAgICAgICAgJGVtYWlsID0gdHJpbShzdHJfcmVwbGFjZSgnPicsICcnLCAkZW1haWwpKTsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT52YWxpZGF0ZUFkZHJlc3MoJGVtYWlsKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJGFkZHJlc3Nlc1tdID0gYXJyYXkoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ25hbWUnID0+IHRyaW0oc3RyX3JlcGxhY2UoYXJyYXkoJyInLCAiJyIpLCAnJywgJG5hbWUpKSwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcycgPT4gJGVtYWlsDQogICAgICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkYWRkcmVzc2VzOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNldCB0aGUgRnJvbSBhbmQgRnJvbU5hbWUgcHJvcGVydGllcy4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRhZGRyZXNzDQogICAgICogQHBhcmFtIHN0cmluZyAkbmFtZQ0KICAgICAqIEBwYXJhbSBib29sZWFuICRhdXRvIFdoZXRoZXIgdG8gYWxzbyBzZXQgdGhlIFNlbmRlciBhZGRyZXNzLCBkZWZhdWx0cyB0byB0cnVlDQogICAgICogQHRocm93cyBwaHBtYWlsZXJFeGNlcHRpb24NCiAgICAgKiBAcmV0dXJuIGJvb2xlYW4NCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gc2V0RnJvbSgkYWRkcmVzcywgJG5hbWUgPSAnJywgJGF1dG8gPSB0cnVlKQ0KICAgIHs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9Db25zdGFudCB3YXMgYWRkZWQgaW4gUEhQIDUuMi40DQogICAgICAgICAgICBpZiAoZGVmaW5lZCgnUENSRV9WRVJTSU9OJykpIHsNCiAgICAgICAgICAgICAgICAvL1RoaXMgcGF0dGVybiBjYW4gZ2V0IHN0dWNrIGluIGEgcmVjdXJzaXZlIGxvb3AgaW4gUENSRSA8PSA4LjAuMg0KICAgICAgICAgICAgICAgIGlmICh2ZXJzaW9uX2NvbXBhcmUoUENSRV9WRVJTSU9OLCAnOC4wLjMnKSA+PSAwKSB7DQogICAgICAgICAgICAgICAgICAgICRwYXR0ZXJuc2VsZWN0ID0gJ3BjcmU4JzsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkcGF0dGVybnNlbGVjdCA9ICdwY3JlJzsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9IGVsc2VpZiAoZnVuY3Rpb25fZXhpc3RzKCdleHRlbnNpb25fbG9hZGVkJykgYW5kIGV4dGVuc2lvbl9sb2FkZWQoJ3BjcmUnKSkgew0KICAgICAgICAgICAgICAgIC8vRmFsbCBiYWNrIHRvIG9sZGVyIFBDUkUNCiAgICAgICAgICAgICAgICAkcGF0dGVybnNlbGVjdCA9ICdwY3JlJzsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgLy9GaWx0ZXJfdmFyIGFwcGVhcmVkIGluIFBIUCA1LjIuMCBhbmQgZG9lcyBub3QgcmVxdWlyZSB0aGUgUENSRSBleHRlbnNpb24NCiAgICAgICAgICAgICAgICBpZiAodmVyc2lvbl9jb21wYXJlKFBIUF9WRVJTSU9OLCAnNS4yLjAnKSA+PSAwKSB7DQogICAgICAgICAgICAgICAgICAgICRwYXR0ZXJuc2VsZWN0ID0gJ3BocCc7DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJHBhdHRlcm5zZWxlY3QgPSAnbm9yZWdleCc7DQogICAgICA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KD8zKSkpKig/MilcKSkpKyg/MikpfCg/MikpPyknIC4NCiAgICAgICAgICAgICAgICAgICAgJyhbISMtXCcqK1wvLTk9P14tfi1dK3wiKD8+KD8yKSg/PltceDAxLVx4MDhceDBCXHgwQ1x4MEUtISMtXFtcXS1ceDdGXXxcXFxbXHgwMC1ceDdGXSkpKicgLg0KICAgICAgICAgICAgICAgICAgICAnKD8yKSIpKD8+KD8xKVwuKD8xKSg/NCkpKig/MSlAKD8hKD8xKVthLXowLTktXXs2NCx9KSg/MSkoPz4oW2EtejAtOV0oPz5bYS16MC05LV0qW2EtejAtOV0pPyknIC4NCiAgICAgICAgICAgICAgICAgICAgJyg/Pig/MSlcLig/ISg/MSlbYS16MC05LV17NjQsfSkoPzEpKD81KSl7MCwxMjZ9fFxbKD86KD8+SVB2NjooPz4oW2EtZjAtOV17MSw0fSkoPz46KD82KSl7N30nIC4NCiAgICAgICAgICAgICAgICAgICAgJ3woPyEoPzouKlthLWYwLTldWzpcXV0pezgsfSkoKD82KSg/PjooPzYpKXswLDZ9KT86Oig/Nyk/KSl8KD8+KD8+SVB2NjooPz4oPzYpKD8+Oig/NikpezV9OicgLg0KICAgICAgICAgICAgICAgICAgICAnfCg/ISg/Oi4qW2EtZjAtOV06KXs2LH0pKD84KT86Oig/PigoPzYpKD8+Oig/NikpezAsNH0pOik/KSk/KDI1WzAtNV18MlswLTRdWzAtOV18MVswLTldezJ9JyAuDQogICAgICAgICAgICAgICAgICAgICd8WzEtOV0/WzAtOV0pKD8+XC4oPzkpKXszfSkpXF0pKD8xKSQvaXNEJywNCiAgICAgICAgICAgICAgICAgICAgJGFkZHJlc3MNCiAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgY2FzZSAncGNyZSc6DQogICAgICAgICAgICAgICAgLy9BbiBvbGRlciByZWdleCB0aGF0IGRvZXNuJ3QgbmVlZCBhIHJlY2VudCBQQ1JFDQogICAgICAgICAgICAgICAgcmV0dXJuIChib29sZWFuKXByZWdfbWF0Y2goDQogICAgICAgICAgICAgICAgICAgICcvXig/ISg/PiI/KD8+XFxcWyAtfl18W14iXSkiPyl7MjU1LH0pKD8hKD8+Ij8oPz5cXFxbIC1+XXxbXiJdKSI/KXs2NSx9QCkoPz4nIC4NCiAgICAgICAgICAgICAgICAgICAgJ1shIy1cJyorXC8tOT0/Xi1+LV0rfCIoPz4oPz5bXHgwMS1ceDA4XHgwQlx4MENceDBFLSEjLVxbXF0tXHg3Rl18XFxcW1x4MDAtXHhGRl0pKSoiKScgLg0KICAgICAgICAgICAgICAgICAgICAnKD8+XC4oPz5bISMtXCcqK1wvLTk9P14tfi1dK3wiKD8+KD8+W1x4MDEtXHgwOFx4MEJceDBDXHgwRS0hIy1cW1xdLVx4N0ZdfFxcXFtceDAwLVx4RkZdKSkqIikpKicgLg0KICAgICAgICAgICAgICAgICAgICAnQCg/Pig/IVthLXowLTktXXs2NCx9KSg/PlthLXowLTldKD8+W2EtejAtOS1dKlthLXowLTldKT8pKD8+XC4oPyFbYS16MC05LV17NjQsfSknIC4NCiAgICAgICAgICAgICAgICAgICAgJyg/PlthLXowLTldKD8+W2EtejAtOS1dKlthLXowLTldKT8pKXswLDEyNn18XFsoPzooPz5JUHY2Oig/Pig/PlthLWYwLTldezEsNH0pKD8+OicgLg0KICAgICAgICAgICAgICAgICAgICAnW2EtZjAtOV17MSw0fSl7N318KD8hKD86LipbYS1mMC05XVs6XF1dKXs4LH0pKD8+W2EtZjAtOV17MSw0fSg/PjpbYS1mMC05XXsxLDR9KXswLDZ9KT8nIC4NCiAgICAgICAgICAgICAgICAgICAgJzo6KD8+W2EtZjAtOV17MSw0fSg/PjpbYS1mMC05XXsxLDR9KXswLDZ9KT8pKXwoPz4oPz5JUHY2Oig/PlthLWYwLTldezEsNH0oPz46JyAuDQogICAgICAgICAgICAgICAgICAgICdbYS1mMC05XXsxLDR9KXs1fTp8KD8hKD86LipbYS1mMC05XTopezYsfSkoPz5bYS1mMC05XXsxLDR9KD8+OlthLWYwLTldezEsNH0pezAsNH0pPycgLg0KICAgICAgICAgICAgICAgICAgICAnOjooPz4oPzpbYS1mMC05XXsxLDR9KD8+OlthLWYwLTldezEsNH0pezAsNH0pOik/KSk/KD8+MjVbMC01XXwyWzAtNF1bMC05XXwxWzAtOV17Mn0nIC4NCiAgICAgICAgICAgICAgICAgICAgJ3xbMS05XT9bMC05XSkoPz5cLig/PjI1WzAtNV18MlswLTRdWzAtOV18MVswLTldezJ9fFsxLTldP1swLTldKSl7M30pKVxdKSQvaXNEJywNCiAgICAgICAgICAgICAgICAgICAgJGFkZHJlc3MNCiAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgY2FzZSAnaHRtbDUnOg0KICAgICAgICAgICAgICAgIC8qKg0KICAgICAgICAgICAgICAgICAqIFRoaXMgaXMgdGhlIHBhdHRlcm4gdXNlZCBpbiB0aGUgSFRNTDUgc3BlYyBmb3IgdmFsaWRhdGlvbiBvZiAnZW1haWwnIHR5cGUgZm9ybSBpbnB1dCBlbGVtZW50cy4NCiAgICAgICAgICAgICAgICAgKiBAbGluayBodHRwOi8vd3d3LndoYXR3Zy5vcmcvc3BlY3Mvd2ViLWFwcHMvY3VycmVudC13b3JrLyNlLW1haWwtc3RhdGUtKHR5cGU9ZW1haWwpDQogICAgICAgICAgICAgICAgICovDQogICAgICAgICAgICAgICAgcmV0dXJuIChib29sZWFuKXByZWdfbWF0Y2goDQogICAgICAgICAgICAgICAgICAgICcvXlthLXpBLVowLTkuISMkJSZcJyorXC89P15fYHt8fX4tXStAW2EtekEtWjAtOV0oPzpbYS16QS1aMC05LV17MCw2MX0nIC4NCiAgICAgICAgICAgICAgICAgICAgJ1thLXpBLVowLTldKT8oPzpcLlthLXpBLVowLTldKD86W2EtekEtWjAtOS1dezAsNjF9W2EtekEtWjAtOV0pPykqJC9zRCcsDQogICAgICAgICAgICAgICAgICAgICRhZGRyZXNzDQogICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgIGNhc2UgJ25vcmVnZXgnOg0KICAg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LiAkcHVueWNvZGU7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkYWRkcmVzczsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBDcmVhdGUgYSBtZXNzYWdlIGFuZCBzZW5kIGl0Lg0KICAgICAqIFVzZXMgdGhlIHNlbmRpbmcgbWV0aG9kIHNwZWNpZmllZCBieSAkTWFpbGVyLg0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQHJldHVybiBib29sZWFuIGZhbHNlIG9uIGVycm9yIC0gU2VlIHRoZSBFcnJvckluZm8gcHJvcGVydHkgZm9yIGRldGFpbHMgb2YgdGhlIGVycm9yLg0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBzZW5kKCkNCiAgICB7DQogICAgICAgIHRyeSB7DQogICAgICAgICAgICBpZiAoISR0aGlzLT5wcmVTZW5kKCkpIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gJHRoaXMtPnBvc3RTZW5kKCk7DQogICAgICAgIH0gY2F0Y2ggKHBocG1haWxlckV4Y2VwdGlvbiAkZXhjKSB7DQogICAgICAgICAgICAkdGhpcy0+bWFpbEhlYWRlciA9ICcnOw0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICBpZiAoJHRoaXMtPmV4Y2VwdGlvbnMpIHsNCiAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgfQ0KDQogICAgLyoqDQogICAgICogUHJlcGFyZSBhIG1lc3NhZ2UgZm9yIHNlbmRpbmcuDQogICAgICogQHRocm93cyBwaHBtYWlsZXJFeGNlcHRpb24NCiAgICAgKiBAc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raW5kKSB7DQogICAgICAgICAgICAgICAgJHRoaXMtPiRhZGRyZXNzX2tpbmQgPSB0cmltKCR0aGlzLT4kYWRkcmVzc19raW5kKTsNCiAgICAgICAgICAgICAgICBpZiAoZW1wdHkoJHRoaXMtPiRhZGRyZXNzX2tpbmQpKSB7DQogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAkdGhpcy0+JGFkZHJlc3Nfa2luZCA9ICR0aGlzLT5wdW55ZW5jb2RlQWRkcmVzcygkdGhpcy0+JGFkZHJlc3Nfa2luZCk7DQogICAgICAgICAgICAgICAgaWYgKCEkdGhpcy0+dmFsaWRhdGVBZGRyZXNzKCR0aGlzLT4kYWRkcmVzc19raW5kKSkgew0KICAgICAgICAgICAgICAgICAgICAkZXJyb3JfbWVzc2FnZSA9ICR0aGlzLT5sYW5nKCdpbnZhbGlkX2FkZHJlc3MnKSAuICR0aGlzLT4kYWRkcmVzc19raW5kOw0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+c2V0RXJyb3IoJGVycm9yX21lc3NhZ2UpOw0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+ZWRlYnVnKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT5leGNlcHRpb25zKSB7DQogICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAvLyBTZXQgd2hldGhlciB0aGUgbWVzc2FnZSBpcyBtdWx0aXBhcnQvYWx0ZXJuYXRpdmUNCiAgICAgICAgICAgIGlmICghZW1wdHkoJHRoaXMtPkFsdEJvZHkpKSB7DQ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XB0dXJlIHRoZSBjb21wbGV0ZSBtZXNzYWdlIHdoZW4gdXNpbmcgbWFpbCgpLCBjcmVhdGUNCiAgICAgICAgICAgIC8vIGFuIGV4dHJhIGhlYWRlciBsaXN0IHdoaWNoIGNyZWF0ZUhlYWRlcigpIGRvZXNuJ3QgZm9sZCBpbg0KICAgICAgICAgICAgaWYgKCR0aGlzLT5NYWlsZXIgPT0gJ21haWwnKSB7DQogICAgICAgICAgICAgICAgaWYgKGNvdW50KCR0aGlzLT50bykgPiAwKSB7DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5tYWlsSGVhZGVyIC49ICR0aGlzLT5hZGRyQXBwZW5kKCdUbycsICR0aGlzLT50byk7DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPm1haWxIZWFkZXIgLj0gJHRoaXMtPmhlYWRlckxpbmUoJ1RvJywgJ3VuZGlzY2xvc2VkLXJlY2lwaWVudHM6OycpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAkdGhpcy0+bWFpbEhlYWRlciAuPSAkdGhpcy0+aGVhZGVyTGluZSgNCiAgICAgICAgICAgICAgICAgICAgJ1N1YmplY3QnLA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+ZW5jb2RlSGVhZGVyKCR0aGlzLT5zZWN1cmVIZWFkZXIodHJpbSgkdGhpcy0+U3ViamVjdCkpKQ0KICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIC8vIFNpZ24gd2l0aCBES0lNIGlmIGVuYWJsZWQNCiAgICAgICAgICAgIGlmICghZW1wdHkoJHRoaXMtPkRLSU1fZG9tYWluKQ0KICAgICAgICAgICAgICAgICYmICFlbXB0eSgkdGhpcy0+REtJTV9wcml2YXRlKQ0KICAgICAgICAgICAgICAgICYmICFlbXB0eSgkdGhpcy0+REtJTV9zZWxlY3RvcikNCiAgICAgICAgICAgICAgICAmJiBmaWxlX2V4aXN0cygkdGhpcy0+REtJTV9wcml2YXRlKSkgew0KICAgICAgICAgICAgICAgICRoZWFkZXJfZGtpbSA9ICR0aGlzLT5ES0lNX0FkZCgNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPk1JTUVIZWFkZXIgLiAkdGhpcy0+bWFpbEhlYWRlciwNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPmVuY29kZUhlYWRlcigkdGhpcy0+c2VjdXJlSGVhZGVyKCR0aGlzLT5TdWJqZWN0KSksDQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5NSU1FQm9keQ0KICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgJHRoaXMtPk1JTUVIZWFkZXIgPSBydHJpbSgkdGhpcy0+TUlNRUhlYWRlciwgIlxyXG4gIikgLiBzZWxmOjpDUkxGIC4NCiAgICAgICAgICAgICAgICAgICAgc3RyX3JlcGxhY2UoIlxyXG4iLCAiXG4iLCAkaGVhZGVyX2RraW0pIC4gc2VsZjo6Q1JMRjsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICB9IGNhdGNoIChwaHBtYWlsZXJFeGNlcHRpb24gJGV4Yykgew0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICBpZiAoJHRoaXMtPmV4Y2VwdGlvbnMpIHsNCiAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgfQ0KICAgIHB1YmxpYyBmdW5jdGlvbiBpbm5lckJvZHkoKXsNCg0KICAgICAgICANCiAgICB9DQogICAgLyoqDQogICAgICogQWN0dWFsbHkgc2VuZCBhIG1lc3NhZ2UuDQogICAgICogU2VuZCB0aGUgZW1haWwgdmlhIHRoZSBzZWxlY3RlZCBtZWNoYW5pc20NCiAgICAgKiBAdGhyb3dzIHBocG1haWxlckV4Y2VwdGlvbg0KICAgICAqIEByZXR1cm4gYm9vbGVhbg0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBwb3N0U2VuZCgpDQogICAgew0KICAgICAgICB0cnkgew0KICAgICAgICAgICAgLy8gQ2hvb3NlIHRoZSBtYWlsZXIgYW5kIHNlbmQgdGhyb3VnaCBpdA0KICAgICAgICAgICAgc3dpdGNoICgkdGhpcy0+TWFpbGVyKSB7DQogICAgICAgICAgICAgICAgY2FzZSAnc2VuZG1haWwnOg0KICAgICAgICAgICAgICAgIGNhc2UgJ3FtYWlsJzoNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5zZW5kbWFpbFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICAgICAgY2FzZSAnc210cCc6DQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+c210cFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICAgICAgY2FzZSAnbWFpbCc6DQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+bWFpbFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgICAgICAgICAgJHNlbmRNZXRob2QgPSAkdGhpcy0+TWFpbGVyLidTZW5kJzsNCiAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZF9leGlzdHMoJHRoaXMsICRzZW5kTWV0aG9kKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT4kc2VuZE1ldGhvZCgkdGhpcy0+TUlNRUhlYWRlciwgJHRoaXMtPk1JTUVCb2R5KTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIHJldHVybiAk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AgICBmcHV0cygkbWFpbCwgJGJvZHkpOw0KICAgICAgICAgICAgICAgICRyZXN1bHQgPSBwY2xvc2UoJG1haWwpOw0KICAgICAgICAgICAgICAgICR0aGlzLT5kb0NhbGxiYWNrKA0KICAgICAgICAgICAgICAgICAgICAoJHJlc3VsdCA9PSAwKSwNCiAgICAgICAgICAgICAgICAgICAgYXJyYXkoJHRvQWRkciksDQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5jYywNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPmJjYywNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPlN1YmplY3QsDQogICAgICAgICAgICAgICAgICAgICRib2R5LA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+RnJvbQ0KICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgaWYgKCRyZXN1bHQgIT0gMCkgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleGVjdXRlJykgLiAkdGhpcy0+U2VuZG1haWwsIHNlbGY6OlNUT1BfQ1JJVElDQUwpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgIGlmICghQCRtYWlsID0gcG9wZW4oJHNlbmRtYWlsLCAndycpKSB7DQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnZXhlY3V0ZScpIC4gJHRoaXMtPlNlbmRtYWlsLCBzZWxmOjpTVE9QX0NSSVRJQ0FMKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGZwdXRzKCRtYWlsLCAkaGVhZGVyKTsNCiAgICAgICAgICAgIGZwdXRzKCRtYWlsLCAkYm9keSk7DQogICAgICAgICAgICAkcmVzdWx0ID0gcGNsb3NlKCRtYWlsKTsNCiAgICAgICAgICAgICR0aGlzLT5kb0NhbGxiYWNrKA0KICAgICAgICAgICAgICAgICgkcmVzdWx0ID09IDApLA0KICAgICAgICAgICAgICAgICR0aGlzLT50bywNCiAgICAgICAgICAgICAgICAkdGhpcy0+Y2MsDQogICAgICAgICAgICAgICAgJHRoaXMtPmJjYywNCiAgICAgICAgICAgICAgICAkdGhpcy0+U3ViamVjdCwNCiAgICAgICAgICAgICAgICAkYm9keSwNCiAgICAgICAgICAgICAgICAkdGhpcy0+RnJvbQ0KICAgICAgICAgICAgKTsNCiAgICAgICAgICAgIGlmICgkcmVzdWx0ICE9IDApIHsNCiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleGVjdXRlJykgLiAkdGhpcy0+U2VuZG1haWwsIHNlbGY6OlNUT1BfQ1JJVElDQUwpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNlbmQgbWFpbCB1c2luZyB0aGUgUEhQIG1haWwoKSBmdW5jdGlvbi4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRoZWFkZXIgVGhlIG1lc3NhZ2UgaGVhZGVycw0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGJvZHkgVGhlIG1lc3NhZ2UgYm9keQ0KICAgICAqIEBsaW5rIGh0dHA6Ly93d3cucGhwLm5ldC9tYW51YWwvZW4vYm9vay5tYWlsLnBocA0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQGFjY2VzcyBwcm90ZWN0ZWQNCiAgICAgKiBAcmV0dXJuIGJvb2xlYW4NCiAgICAgKi8NCiAgICBwcm90ZWN0ZWQgZnVuY3Rpb24gbWFpbFNlbmQoJGhlYWRlciwgJGJvZHkpDQogICAgew0KICAgICAgICAkdG9BcnIgPSBhcnJheSgpOw0KICAgICAgICBmb3JlYWNoICgkdGhpcy0+dG8gYXMgJHRvYWRkcikgew0KICAgICAgICAgICAgJHRvQXJyW10gPSAkdGhpcy0+YWRkckZvcm1hdCgkdG9hZGRyKTsNCiAgICAgICAgfQ0KICAgICAgICAkdG8gPSBpbXBsb2RlKCcsICcsICR0b0Fycik7DQoNCiAgICAgICAgaWYgKGVtcHR5KCR0aGlzLT5TZW5kZXIpKSB7DQogICAgICAgICAgICAkcGFyYW1zID0gJyAnOw0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgJHBhcmFtcyA9IHNwcmludGYoJy1mJXMnLCAkdGhpcy0+U2VuZGVyKTsNCiAgICAgICAgfQ0KICAgICAgICBpZiAoJHRoaXMtPlNlbmRlciAhPSAnJyBhbmQgIWluaV9nZXQoJ3NhZmVfbW9kZScpKSB7DQogICAgICAgICAgICAkb2xkX2Zyb20gPSBpbmlfZ2V0KCdzZW5kbWFpbF9mcm9tJyk7DQogICAgICAgICAgICBpbmlfc2V0KCdzZW5kbWFpbF9mcm9tJywgJHRoaXMtPlNlbmRlcik7DQogICAgICAgIH0NCiAgICAgICAgJHJlc3VsdCA9IGZhbHNlOw0KICAgICAgICBpZiAoJHRoaXMtPlNpbmdsZVRvICYmIGNvdW50KCR0b0FycikgPiAxKSB7DQogICAgICAgICAgICBmb3JlYWNoICgkdG9BcnIgYXMgJHRvQWRkcikgew0KICAgICAgICAgICAgICAgICRyZXN1bHQgPSAkdGhpcy0+bWFpbFBhc3N0aHJ1KCR0b0FkZHIsICR0aGlzLT5TdWJqZWN0LCAkYm9keSwgJGhlYWRlciwgJHBhcmFtcyk7DQogICAgICAgICAgICAgICAgJHRoaXMtPmRvQ2FsbGJhY2soJHJlc3VsdCwgYXJyYXkoJHRvQWRkciksICR0aGlzLT5jYywgJHRoaXMtPmJjYywgJHRoaXMtPlN1YmplY3QsICRib2R5LCAkdGhpcy0+RnJvbSk7DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAkcmVzdWx0ID0gJHRoaXMtPm1haWxQYXNzdGhydSgkdG8sICR0aGlzLT5TdWJqZWN0LCAkYm9keSwgJGhlYWRlciwgJHBhcmFtcyk7DQogICAgICAgICAgICAkdGhpcy0+ZG9DYWxsYmFjaygkcmVzdWx0LCAkdGhpcy0+dG8sICR0aGlzLT5jYywgJHRoaXMtPmJjYywgJHRoaXMtPlN1YmplY3QsICRib2R5LCAkdGhpcy0+RnJvbSk7DQogICAgICAgIH0NCiAgICAgICAgaWYgKGlzc2V0KCRvbGRfZnJvbSkpIHsNCiAgICAgICAgICAgIGluaV9zZXQoJ3NlbmRtYWlsX2Zyb20nLCAkb2xkX2Zyb20pOw0KICAgICAgICB9DQogICAgICAgIGlmICghJHJlc3VsdCkgew0KICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnaW5zdGFudGlhdGUnKSwgc2VsZjo6U1RPUF9DUklUSUNBTCk7DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuIHRydWU7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogR2V0IGFuIGluc3RhbmNlIHRvIHVzZSBmb3IgU01UUCBvcGVyYXRpb25zLg0KICAgICAqIE92ZXJyaWRlIHRoaXMgZnVuY3Rpb24gdG8gbG9hZCB5b3VyIG93biBTTVRQIGltcGxlbWVudGF0aW9uDQogICAgICogQHJldHVybiBTTVRQDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGdldFNNVFBJbnN0YW5jZSgpDQogICAgew0KICAgICAgICBpZiAoIWlzX29iamVjdCgkdGhpcy0+c210cCkpIHsNCiAgICAgICAgICAgICR0aGlzLT5zbXRwID0gbmV3IFNNVFA7DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuICR0aGlzLT5zbXRwOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNlbmQgbWFpbCB2aWEgU01UUC4NCiAgICAgKiBSZXR1cm5zIGZhbHNlIGlmIHRoZXJlIGlzIGEgYmFkIE1BSUwgRl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5sYW5nKCdmcm9tX2ZhaWxlZCcpIC4gJHNtdHBfZnJvbSAuICcgOiAnIC4gaW1wbG9kZSgnLCcsICR0aGlzLT5zbXRwLT5nZXRFcnJvcigpKSk7DQogICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5FcnJvckluZm8sIHNlbGY6OlNUT1BfQ1JJVElDQUwpOw0KICAgICAgICB9DQoNCiAgICAgICAgLy8gQXR0ZW1wdCB0byBzZW5kIHRvIGFsbCByZWNpcGllbnRzDQogICAgICAgIGZvcmVhY2ggKGFycmF5KCR0aGlzLT50bywgJHRoaXMtPmNjLCAkdGhpcy0+YmNjKSBhcyAkdG9ncm91cCkgew0KICAgICAgICAgICAgZm9yZWFjaCAoJHRvZ3JvdXAgYXMgJHRvKSB7DQogICAgICAgICAgICAgICAgaWYgKCEkdGhpcy0+c210cC0+cmVjaXBpZW50KCR0b1swXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgJGVycm9yID0gJHRoaXMtPnNtdHAtPmdldEVycm9yKCk7DQogICAgICAgICAgICAgICAgICAgICRiYWRfcmNwdFtdID0gYXJyYXkoJ3RvJyA9PiAkdG9bMF0sICdlcnJvcicgPT4gJGVycm9yWydkZXRhaWwnXSk7DQogICAgICAgICAgICAgICAgICAgICRpc1NlbnQgPSBmYWxzZTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkaXNTZW50ID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJHRoaXMtPmRvQ2FsbGJhY2soJGlzU2VudCwgYXJyYXkoJHRvWzBdKSwgYXJyYXkoKSwgYXJyYXkoKSwgJHRoaXMtPlN1YmplY3QsICRib2R5LCAkdGhpcy0+RnJvbSk7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCg0KICAgICAgICAvLyBPbmx5IHNlbmQgdGhlIERBVEEgY29tbWFuZCBpZiB3ZSBoYXZlIHZpYWJsZSByZWNpcGllbnRzDQogICAgICAgIGlmICgoY291bnQoJHRoaXMtPmFsbF9yZWNpcGllbnRzKSA+IGNvdW50KCRiYWRfcmNwdCkpIGFuZCAhJHRoaXMtPnNtdHAtPmRhdGEoJGhlYWRlciAuICRib2R5KSkgew0KICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnZGF0YV9ub3RfYWNjZXB0ZWQnKSwgc2VsZjo6U1RPUF9DUklUSUNBTCk7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCR0aGlzLT5TTVRQS2VlcEFsaXZlKSB7DQogICAgICAgICAgICAkdGhpcy0+c210cC0+cmVzZXQoKTsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICR0aGlzLT5zbXRwLT5xdWl0KCk7DQogICAgICAgICAgICAkdGhpcy0+c210cC0+Y2xvc2UoKTsNCiAgICAgICAgfQ0KICAgICAgICAvL0NyZWF0ZSBlcnJvciBtZXNzYWdlIGZvciBhbnkgYmFkIGFkZHJlc3Nlcw0KICAgICAgICBpZiAoY291bnQoJGJhZF9yY3B0KSA+IDApIHsNCiAgICAgICAgICAgICRlcnJzdHIgPSAnJzsNCiAgICAgICAgICAgIGZvcmVhY2ggKCRiYWRfcmNwdCBhcyAkYmFkKSB7DQogICAgICAgICAgICAgICAgJGVycnN0ciAuPSAkYmFkWyd0byddIC4gJzogJyAuICRiYWRbJ2Vycm9yJ107DQogICAgICAgICAgICB9DQogICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKA0KICAgICAgICAgICAgICAgICR0aGlzLT5sYW5nKCdyZWNpcGllbnRzX2ZhaWxlZCcpIC4gJGVycnN0ciwNCiAgICAgICAgICAgICAgICBzZWxmOjpTVE9QX0NPTlRJTlVFDQogICAgICAgICAgICApOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0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VwdGlvbiA9IG51bGw7DQoNCiAgICAgICAgZm9yZWFjaCAoJGhvc3RzIGFzICRob3N0ZW50cnkpIHsNCiAgICAgICAgICAgICRob3N0aW5mbyA9IGFycmF5KCk7DQogICAgICAgICAgICBpZiAoIXByZWdfbWF0Y2goJy9eKChzc2x8dGxzKTpcL1wvKSooW2EtekEtWjAtOVwuLV0qKTo/KFswLTldKikkLycsIHRyaW0oJGhvc3RlbnRyeSksICRob3N0aW5mbykpIHsNCiAgICAgICAgICAgICAgICAvLyBOb3QgYSB2YWxpZCBob3N0IGVudHJ5DQogICAgICAgICAgICAgICAgY29udGludWU7DQogICAgICAgICAgICB9DQogICAgICAgICAgICAvLyAkaG9zdGluZm9bMl06IG9wdGlvbmFsIHNzbCBvciB0bHMgcHJlZml4DQogICAgICAgICAgICAvLyAkaG9zdGluZm9bM106IHRoZSBob3N0bmFtZQ0KICAgICAgICAgICAgLy8gJGhvc3RpbmZvWzRdOiBvcHRpb25hbCBwb3J0IG51bWJlcg0KICAgICAgICAgICAgLy8gVGhlIGhvc3Qgc3RyaW5nIHByZWZpeCBjYW4gdGVtcG9yYXJpbHkgb3ZlcnJpZGUgdGhlIGN1cnJlbnQgc2V0dGluZyBmb3IgU01UUFNlY3VyZQ0KICAgICAgICAgICAgLy8gSWYgaXQncyBub3Qgc3BlY2lmaWVkLCB0aGUgZGVmYXVsdCB2YWx1ZSBpcyB1c2VkDQogICAgICAgICAgICAkcHJlZml4ID0gJyc7DQogICAgICAgICAgICAkc2VjdXJlID0gJHRoaXMtPlNNVFBTZWN1cmU7DQogICAgICAgICAgICAkdGxzID0gKCR0aGlzLT5TTVRQU2VjdXJlID09ICd0bHMnKTsNCiAgICAgICAgICAgIGlmICgnc3NsJyA9PSAkaG9zdGluZm9bMl0gb3IgKCcnID09ICRob3N0aW5mb1syXSBhbmQgJ3NzbCcgPT0gJHRoaXMtPlNNVFBTZWN1cmUpKSB7DQogICAgICAgICAgICAgICAgJHByZWZpeCA9ICdzc2w6Ly8nOw0KICAgICAgICAgICAgICAgICR0bHMgPSBmYWxzZTsgLy8gQ2FuJ3QgaGF2ZSBTU0wgYW5kIFRMUyBhdCB0aGUgc2FtZSB0aW1lDQogICAgICAgICAgICAgICAgJHNlY3VyZSA9ICdzc2wnOw0KICAgICAgICAgICAgfSBlbHNlaWYgKCRob3N0aW5mb1syXSA9PSAndGxzJykgew0KICAgICAgICAgICAgICAgICR0bHMgPSB0cnVlOw0KICAgICAgICAgICAgICAgIC8vIHRscyBkb2Vzbid0IHVzZSBhIHByZWZpeA0KICAgICAgICAgICAgICAgICRzZWN1cmUgPSAndGxzJzsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIC8vRG8gd2UgbmVlZCB0aGUgT3BlblNTTCBleHRlbnNpb24/DQogICAgICAgICAgICAkc3NsZXh0ID0gZGVmaW5lZCgnT1BFTlNTTF9BTEdPX1NIQTEnKTsNCiAgICAgICAgICAgIGlmICgndGxzJyA9PT0gJHNlY3VyZSBvciAnc3NsJyA9PT0gJHNlY3VyZSkgew0KICAgICAgICAgICAgICAgIC8vQ2hlY2sgZm9yIGFuIE9wZW5TU0wgY29uc3RhbnQgcmF0aGVyIHRoYW4gdXNpbmcgZXh0ZW5zaW9uX2xvYWRlZCwgd2hpY2ggaXMgc29tZXRpbWVzIGRpc2FibGVkDQogICAgICAgICAgICAgICAgaWYgKCEkc3NsZXh0KSB7DQogICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2V4dGVuc2lvbl9taXNzaW5nJykuJ29wZW5zc2wnLCBzZWxmOjpTVE9QX0NSSVRJQ0FMKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICAkaG9zdCA9ICRob3N0aW5mb1szXTsNCiAgICAgICAgICAgICRwb3J0ID0gJHRoaXMtPlBvcnQ7DQogICAgICAgICAgICAkdHBvcnQgPSAoaW50ZWdlcikkaG9zdGluZm9bNF07DQogICAgICAgICAgICBpZiAoJHRwb3J0ID4gMCBhbmQgJHRwb3J0IDwgNjU1MzYpIHsNCiAgICAgICAgICAgICAgICAkcG9ydCA9ICR0cG9ydDsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGlmICgkdGhpcy0+c210cC0+Y29ubmVjdCgkcHJlZml4IC4gJGhvc3QsICRwb3J0LCAkdGhpcy0+VGltZW91dCwgJG9wdGlvbnMpKSB7DQogICAgICAgICAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT5IZWxvKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkaGVsbG8gPSAkdGhpcy0+SGVsbzsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRoZWxsbyA9ICR0aGlzLT5zZXJ2ZXJIb3N0bmFtZSgpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5zbXRwLT5oZWxsbygkaGVsbG8pOw0KICAgICAgICAgICAgICAgICAgICAvL0F1dG9tYXRpY2FsbHkgZW5hYmxlIFRMUyBlbmNyeXB0aW9uIGlmOg0KICAgICAgICAgICAgICAgICAgICAvLyAqIGl0J3Mgbm90IGRpc2FibGVkDQogICAgICAgICAgICAgICAgICAgIC8vICogd2UgaGF2ZSBvcGVuc3NsIGV4dGVuc2lvbg0KICAgICAgICAgICAgICAgICAgICAvLyAqIHdlIGFyZSBub3QgYWxyZWFkeSB1c2luZyBTU0wNCiAgICAgICAgICAgICAgICAgICAgLy8gKiB0aGUgc2VydmVyIG9mZmVycyBTVEFSVFRMUw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPlNNVFBBdXRvVExTIGFuZCAkc3NsZXh0IGFuZCAkc2VjdXJlICE9ICdzc2wnIGFuZCAkdGhpcy0+c210cC0+Z2V0U2VydmVyRXh0KCdTVEFSVFRMUycpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkdGxzID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRscykgew0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEkdGhpcy0+c210cC0+c3RhcnRUTFMoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2Nvbm5lY3RfaG9zdCcpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIG11c3QgcmVzZW5kIEhFTE8gYWZ0ZXIgdGxzIG5lZ290aWF0aW9uDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+c210cC0+aGVsbG8oJGhlbGxvKTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPlNNVFBBdXRoKSB7DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoISR0aGlzLT5zbXRwLT5hdXRoZW50aWNhdGUoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPlVzZXJuYW1lLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5QYXNzd29yZCwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+QXV0aFR5cGUsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPlJlYWxtLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5Xb3Jrc3RhdGlvbg0KICAgICAgICAgICAgICAgICAgICAgICAgKQ0KICAgICAgICAgICAgICAgICAgICAgICAgKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnYXV0aGVudGljYXRlJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHBocG1haWxlckV4Y2VwdGlvbiAkZXhjKSB7DQogICAgICAgICAgICAgICAgICAgICRsYXN0ZXhjZXB0aW9uID0gJGV4YzsNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPmVkZWJ1ZygkZXhjLT5nZXRNZXNzYWdlKCkpOw0KICAgICAgICAgICAgICAgICAgICAvLyBXZSBtdXN0IGhhdmUgY29ubmVjdGVkLCBidXQgdGhlbiBmYWlsZWQgVExTIG9yIEF1dGgsIHNvIGNsb3NlIGNvbm5lY3Rpb24gbmljZWx5DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5zbXRwLT5xdWl0KCk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIC8vIElmIHdlIGdldCBoZXJlLCBhbGwgY29ubmVjdGlvbiBhdHRlbXB0cyBoYXZlIGZhaWxlZCwgc28gY2xvc2UgY29ubmVjdGlvbiBoYXJkDQogICAgICAgICR0aGlzLT5zbXRwLT5jbG9zZSgpOw0KICAgICAgICAvLyBBcyB3ZSd2ZSBjYXVnaHQgYWxsIGV4Y2VwdGlvbnMsIGp1c3QgcmVwb3J0IHdoYXRldmVyIHRoZSBsYXN0IG9uZSB3YXMNCiAgICAgICAgaWYgKCR0aGlzLT5leGNlcHRpb25zIGFuZCAhaXNfbnVsbCgkbGFzdGV4Y2VwdGlvbikpIHsNCiAgICAgICAgICAgIHRocm93ICRsYXN0ZXhjZXB0aW9uOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiBmYWxzZTsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBDbG9zZSB0aGUgYWN0aXZlIFNNVFAgc2Vzc2lvbiBpZiBvbmUgZXhpc3RzLg0KICAgICAqIEByZXR1cm4gdm9pZA0KICAgICAqLw0KIC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ICAgICAgICAgICAgJGJ1ZiA9ICcnOw0KICAgICAgICAgICAgJGZpcnN0d29yZCA9IHRydWU7DQogICAgICAgICAgICBmb3JlYWNoICgkd29yZHMgYXMgJHdvcmQpIHsNCiAgICAgICAgICAgICAgICBpZiAoJHFwX21vZGUgYW5kIChzdHJsZW4oJHdvcmQpID4gJGxlbmd0aCkpIHsNCiAgICAgICAgICAgICAgICAgICAgJHNwYWNlX2xlZnQgPSAkbGVuZ3RoIC0gc3RybGVuKCRidWYpIC0gJGNybGZsZW47DQogICAgICAgICAgICAgICAgICAgIGlmICghJGZpcnN0d29yZCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRzcGFjZV9sZWZ0ID4gMjApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuID0gJHNwYWNlX2xlZnQ7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRpc191dGY4KSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsZW4gPSAkdGhpcy0+dXRmOENoYXJCb3VuZGFyeSgkd29yZCwgJGxlbik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKHN1YnN0cigkd29yZCwgJGxlbiAtIDEsIDEpID09ICc9Jykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuLS07DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKHN1YnN0cigkd29yZCwgJGxlbiAtIDIsIDEpID09ICc9Jykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuIC09IDI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwYXJ0ID0gc3Vic3RyKCR3b3JkLCAwLCAkbGVuKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkd29yZCA9IHN1YnN0cigkd29yZCwgJGxlbik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGJ1ZiAuPSAnICcgLiAkcGFydDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZSAuPSAkYnVmIC4gc3ByaW50ZignPSVzJywgc2VsZjo6Q1JMRik7DQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRtZXNzYWdlIC49ICRidWYgLiAkc29mdF9icmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICRidWYgPSAnJzsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB3aGlsZSAoc3RybGVuKCR3b3JkKSA+IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkbGVuZ3RoIDw9IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICRsZW4gPSAkbGVuZ3RoOw0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRpc191dGY4KSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxlbiA9ICR0aGlzLT51dGY4Q2hhckJvdW5kYXJ5KCR3b3JkLCAkbGVuKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmIChzdWJzdHIoJHdvcmQsICRsZW4gLSAxLCAxKSA9PSAnPScpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuLS07DQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZiAoc3Vic3RyKCR3b3JkLCAkbGVuIC0gMiwgMSkgPT0gJz0nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxlbiAtPSAyOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgJHBhcnQgPSBzdWJzdHIoJHdvcmQsIDAsICRsZW4pOw0KICAgICAgICAgICAgICAgICAgICAgICAgJHdvcmQgPSBzdWJzdHIoJHdvcmQsICRsZW4pOw0KDQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RybGVuKCR3b3JkKSA+IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZSAuPSAkcGFydCAuIHNwcmludGYoJz0lcycsIHNlbGY6OkNSTEYpOw0KICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYnVmID0gJHBhcnQ7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkYnVmX28gPSAkYnVmOw0KICAgICAgICAgICAgICAgICAgICBpZiAoISRmaXJzdHdvcmQpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRidWYgLj0gJyAnOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRidWYgLj0gJHdvcmQ7DQoNCiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmxlbigkYnVmKSA+ICRsZW5ndGggYW5kICRidWZfbyAhPSAnJykgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2UgLj0gJGJ1Zl9vIC4gJHNvZnRfYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAkYnVmID0gJHdvcmQ7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJGZpcnN0d29yZCA9IGZhbHNlOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgJG1lc3NhZ2UgLj0gJGJ1ZiAuIHNlbGY6OkNSTEY7DQogICAgICAgIH0NCg0KICAgICAgICByZXR1cm4gJG1lc3NhZ2U7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogRmluZCB0aGUgbGFzdCBjaGFyYW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gICAkaGV4ID0gc3Vic3RyKCRlbmNvZGVkVGV4dCwgJG1heExlbmd0aCAtICRsb29rQmFjayArICRlbmNvZGVkQ2hhclBvcyArIDEsIDIpOw0KICAgICAgICAgICAgICAgICRkZWMgPSBoZXhkZWMoJGhleCk7DQogICAgICAgICAgICAgICAgaWYgKCRkZWMgPCAxMjgpIHsNCiAgICAgICAgICAgICAgICAgICAgLy8gU2luZ2xlIGJ5dGUgY2hhcmFjdGVyLg0KICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgZW5jb2RlZCBjaGFyIHdhcyBmb3VuZCBhdCBwb3MgMCwgaXQgd2lsbCBmaXQNCiAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIHJlZHVjZSBtYXhMZW5ndGggdG8gc3RhcnQgb2YgdGhlIGVuY29kZWQgY2hhcg0KICAgICAgICAgICAgICAgICAgICBpZiAoJGVuY29kZWRDaGFyUG9zID4gMCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1heExlbmd0aCA9ICRtYXhMZW5ndGggLSAoJGxvb2tCYWNrIC0gJGVuY29kZWRDaGFyUG9zKTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAkZm91bmRTcGxpdFBvcyA9IHRydWU7DQogICAgICAgICAgICAgICAgfSBlbHNlaWYgKCRkZWMgPj0gMTkyKSB7DQogICAgICAgICAgICAgICAgICAgIC8vIEZpcnN0IGJ5dGUgb2YgYSBtdWx0aSBieXRlIGNoYXJhY3Rlcg0KICAgICAgICAgICAgICAgICAgICAvLyBSZWR1Y2UgbWF4TGVuZ3RoIHRvIHNwbGl0IGF0IHN0YXJ0IG9mIGNoYXJhY3Rlcg0KICAgICAgICAgICAgICAgICAgICAkbWF4TGVuZ3RoID0gJG1heExlbmd0aCAtICgkbG9va0JhY2sgLSAkZW5jb2RlZENoYXJQb3MpOw0KICAgICAgICAgICAgICAgICAgICAkZm91bmRTcGxpdFBvcyA9IHRydWU7DQogICAgICAgICAgICAgICAgfSBlbHNlaWYgKCRkZWMgPCAxOTIpIHsNCiAgICAgICAgICAgICAgICAgICAgLy8gTWlkZGxlIGJ5dGUgb2YgYSBtdWx0aSBieXRlIGNoYXJhY3RlciwgbG9vayBmdXJ0aGVyIGJhY2sNCiAgICAgICAgICAgICAgICAgICAgJGxvb2tCYWNrICs9IDM7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAvLyBObyBlbmNvZGVkIGNoYXJhY3RlciBmb3VuZA0KICAgICAgICAgICAgICAgICRmb3VuZFNwbGl0UG9zID0gdHJ1ZTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICByZXR1cm4gJG1heExlbmd0aDsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBBcHBseSB3b3JkIHdyYXBwaW5nIHRvIHRoZSBtZXNzYWdlIGJvZHkuDQogICAgICogV3JhcHMgdGhlIG1lc3NhZ2UgYm9keSB0byB0aGUgbnVtYmVyIG9mIGNoYXJzIHNldCBpbiB0aGUgV29yZFdyYXAgcHJvcGVydHkuDQogICAgICogWW91IHNob3VsZCBvbmx5IGRvIHRoaXMgdG8gcGxhaW4tdGV4dCBib2RpZXMgYXMgd3JhcHBpbmcgSFRNTCB0YWdzIG1heSBicmVhayB0aGVtLg0KICAgICAqIFRoaXMgaXMgY2FsbGVkIGF1dG9tYXRpY2FsbHkgYnkgY3JlYXRlQm9keSgpLCBzbyB5b3UgZG9uJ3QgbmVlZCB0byBjYWxsIGl0IHlvdXJzZWxmLg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIHNldFdvcmRXcmFwKCkNCiAgICB7DQogICAgICAgIGlmICgkdGhpcy0+V29yZFdyYXAgPCAxKSB7DQogICAgICAgICAgICByZXR1cm47DQogICAgICAgIH0NCg0KICAgICAgICBzd2l0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Ghpcy0+U2luZ2xlVG8pIHsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+TWFpbGVyICE9ICdtYWlsJykgew0KICAgICAgICAgICAgICAgIGZvcmVhY2ggKCR0aGlzLT50byBhcyAkdG9hZGRyKSB7DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5TaW5nbGVUb0FycmF5W10gPSAkdGhpcy0+YWRkckZvcm1hdCgkdG9hZGRyKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICBpZiAoY291bnQoJHRoaXMtPnRvKSA+IDApIHsNCiAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPk1haWxlciAhPSAnbWFpbCcpIHsNCiAgICAgICAgICAgICAgICAgICAgJHJlc3VsdCAuPSAkdGhpcy0+YWRkckFwcGVuZCgnVG8nLCAkdGhpcy0+dG8pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0gZWxzZWlmIChjb3VudCgkdGhpcy0+Y2MpID09IDApIHsNCiAgICAgICAgICAgICAgICAkcmVzdWx0IC49ICR0aGlzLT5oZWFkZXJMaW5lKCdUbycsICd1bmRpc2Nsb3NlZC1yZWNpcGllbnRzOjsnKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KDQogICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPmFkZHJBcHBlbmQoJ0Zyb20nLCBhcnJheShhcnJheSh0cmltKCR0aGlzLT5Gcm9tKSwgJHRoaXMtPkZyb21OYW1lKSkpOw0KDQogICAgICAgIC8vIHNlbmRtYWlsIGFuZCBtYWlsKCkgZXh0cmFjdCBDYyBmcm9tIHRoZSBoZWFkZXIgYmVmb3JlIHNlbmRpbmcNCiAgICAgICAgaWYgKGNvdW50KCR0aGlzLT5jYykgPiAwKSB7DQogICAgICAgICAgICAkcmVzdWx0IC49ICR0aGlzLT5hZGRyQXBwZW5kKCdDYycsICR0aGlzLT5jYyk7DQogICAgICAgIH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JyZWFrOw0KICAgICAgICAgICAgY2FzZSAnYXR0YWNoJzoNCiAgICAgICAgICAgIGNhc2UgJ2lubGluZV9hdHRhY2gnOg0KICAgICAgICAgICAgY2FzZSAnYWx0X2F0dGFjaCc6DQogICAgICAgICAgICBjYXNlICdhbHRfaW5saW5lX2F0dGFjaCc6DQogICAgICAgICAgICAgICAgJHJlc3VsdCAuPSAkdGhpcy0+aGVhZGVyTGluZSgnQ29udGVudC1UeXBlJywgJ211bHRpcGFydC9taXhlZDsnKTsNCiAgICAgICAgICAgICAgICAkcmVzdWx0IC49ICR0aGlzLT50ZXh0TGluZSgiXHRib3VuZGFyeT1cIiIgLiAkdGhpcy0+Ym91bmRhcnlbMV0gLiAnIicpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAnYWx0JzoNCiAgICAgICAgICAgIGNhc2UgJ2FsdF9pbmxpbmUnOg0KICAgICAgICAgICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPmhlYWRlckxpbmUoJ0NvbnRlbnQtVHlwZScsICdtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7Jyk7DQogICAgICAgICAgICAgICAgJHJlc3VsdCAuPSAkdGhpcy0+dGV4dExpbmUoIlx0Ym91bmRhcnk9XCIiIC4gJHRoaXMtPmJvdW5kYXJ5WzFdIC4gJyInKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgLy8gQ2F0Y2hlcyBjYXNlICdwbGFpbic6IGFuZCBjYXNlICcnOg0KICAgICAgICAgICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPnRleHRMaW5lKCdDb250ZW50LVR5cGU6ICcgLiAkdGhpcy0+Q29udGVudFR5cGUgLiAnOyBjaGFyc2V0PScgLiAkdGhpcy0+Q2hhclNldCk7DQogICAgICAgICAgICAgICAgJGlzbXVsdGlwYXJ0ID0gZmFsc2U7DQogICAgICAgICAgICAgICAgYnJ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Nhc2UgJ2lubGluZSc6DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJG1pbWVwcmU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmdldEJvdW5kYXJ5KCR0aGlzLT5ib3VuZGFyeVsxXSwgJGJvZHlDaGFyU2V0LCAnJywgJGJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmVuY29kZVN0cmluZygkdGhpcy0+Qm9keSwgJGJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPkxFIC4gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5hdHRhY2hBbGwoJ2lubGluZScsICR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdhdHRhY2gnOg0KICAgICAgICAgICAgICAgICRib2R5IC49ICRtaW1lcHJlOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5nZXRCb3VuZGFyeSgkdGhpcy0+Ym91bmRhcnlbMV0sICRib2R5Q2hhclNldCwgJycsICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkJvZHksICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRSAuICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+YXR0YWNoQWxsKCdhdHRhY2htZW50JywgJHRoaXMtPmJvdW5kYXJ5WzFdKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgJ2lubGluZV9hdHRhY2gnOg0KICAgICAgICAgICAgICAgICRib2R5IC49ICRtaW1lcHJlOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT50ZXh0TGluZSgnLS0nIC4gJHRoaXMtPmJvdW5kYXJ5WzFdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+aGVhZGVyTGluZSgnQ29udGVudC1UeXBlJywgJ211bHRpcGFydC9yZWxhdGVkOycpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT50ZXh0TGluZSgiXHRib3VuZGFyeT1cIiIgLiAkdGhpcy0+Ym91bmRhcnlbMl0gLiAnIicpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+Z2V0Qm91bmRhcnkoJHRoaXMtPmJvdW5kYXJ5WzJdLCAkYm9keUNoYXJTZXQsICcnLCAkYm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+ZW5jb2RlU3RyaW5nKCR0aGlzLT5Cb2R5LCAkYm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmF0dGFjaEFsbCgnaW5saW5lJywgJHRoaXMtPmJvdW5kYXJ5WzJdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmF0dGFjaEFsbCgnYXR0YWNobWVudCcsICR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdhbHQnOg0KICAgICAgICAgICAgICAgICRib2R5IC49ICRtaW1lcHJlOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5nZXRCb3VuZGFyeSgkdGhpcy0+Ym91bmRhcnlbMV0sICRhbHRCb2R5Q2hhclNldCwgJ3RleHQvcGxhaW4nLCAkYWx0Qm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+ZW5jb2RlU3RyaW5nKCR0aGlzLT5BbHRCb2R5LCAkYWx0Qm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmdldEJvdW5kYXJ5KCR0aGlzLT5ib3VuZGFyeVsxXSwgJGJvZHlDaGFyU2V0LCAndGV4dC9odG1sJywgJGJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmVuY29kZVN0cmluZygkdGhpcy0+Qm9keSwgJGJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPkxFIC4gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJHRoaXMtPkljYWwpKSB7DQogICAgICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5nZXRCb3VuZGFyeSgkdGhpcy0+Ym91bmRhcnlbMV0sICcnLCAndGV4dC9jYWxlbmRhcjsgbWV0aG9kPVJFUVVFU1QnLCAnJyk7DQogICAgICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkljYWwsICR0aGlzLT5FbmNvZGluZyk7DQogICAgICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRSAuICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmVuZEJvdW5kYXJ5KCR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdhbHRfaW5saW5lJzoNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkbWltZXByZTsNCiAgICAgICAgICAgICAgICAkYm9ke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KTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPnRleHRMaW5lKCctLScgLiAkdGhpcy0+Ym91bmRhcnlbMl0pOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5oZWFkZXJMaW5lKCdDb250ZW50LVR5cGUnLCAnbXVsdGlwYXJ0L3JlbGF0ZWQ7Jyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPnRleHRMaW5lKCJcdGJvdW5kYXJ5PVwiIiAuICR0aGlzLT5ib3VuZGFyeVszXSAuICciJyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5nZXRCb3VuZGFyeSgkdGhpcy0+Ym91bmRhcnlbM10sICRib2R5Q2hhclNldCwgJ3RleHQvaHRtbCcsICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkJvZHksICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRSAuICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+YXR0YWNoQWxsKCdpbmxpbmUnLCAkdGhpcy0+Ym91bmRhcnlbM10pOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+ZW5kQm91bmRhcnkoJHRoaXMtPmJvdW5kYXJ5WzJdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmF0dGFjaEFsbCgnYXR0YWNobWVudCcsICR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgIC8vIGNhdGNoIGNhc2UgJ3BsYWluJyBhbmQgY2FzZSAnJw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkJvZHksICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQoNCiAgICAgICAgaWYgKCR0aGlzLT5pc0Vycm9yKCkpIHsNCiAgICAgICAgICAgICRib2R5ID0gJyc7DQogICAgICAgIH0gZWxzZWlmICgkdGhpcy0+c2lnbl9rZXlfZmlsZSkgew0KICAgICAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgICAgICBpZiAoIWRlZmluZWQoJ1BLQ1M3X1RFWFQnKSkgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleHRlbnNpb25fbWlzc2luZycpIC4gJ29wZW5zc2wnKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgLy8gQFRPRE8gd291bGQgYmUgbmljZSB0byB1c2UgcGhwOi8vdGVtcCBzdHJlYW1zIGhlcmUsIGJ1dCBuZWVkIHRvIHdyYXAgZm9yIFBIUCA8IDUuMQ0KICAgICAgICAgICAgICAgICRmaWxlID0gdGVtcG5hbShzeXNfZ2V0X3RlbXBfZGlyKCksICdtYWlsJyk7DQogICAgICAgICAgICAgICAgaWYgKGZhbHNlID09PSBmaWxlX3B1dF9jb250ZW50cygkZmlsZSwgJGJvZHkpKSB7DQogICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ3NpZ25pbmcnKSAuICcgQ291bGQgbm90IHdyaXRlIHRlbXAgZmlsZScpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAkc2lnbmVkID0gdGVtcG5hbShzeXNfZ2V0X3RlbXBfZGlyKCksICdzaWduZWQnKTsNCiAgICAgICAgICAgICAgICAvL1dvcmthcm91bmQgZm9yIFBIUCBidWcgaHR0cHM6Ly9idWdzLnBocC5uZXQvYnVnLnBocD9pZD02OTE5Nw0KICAgICAgICAgICAgICAgIGlmIChlbXB0eSgkdGhpcy0+c2lnbl9leHRyYWNlcnRzX2ZpbGUpKSB7DQogICAgICAgICAgICAgICAgICAgICRzaWduID0gQG9wZW5zc2xfcGtjczdfc2lnbigNCiAgICAgICAgICAgICAgICAgICAgICAgICRmaWxlLA0KICAgICAgICAgICAgICAgICAgICAgICAgJHNpZ25lZCwNCiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxlOi8vJyAuIHJlYWxwYXRoKCR0aGlzLT5zaWduX2NlcnRfZmlsZSksDQogICAgICAgICAgICAgICAgICAgICAgICBhcnJheSgnZmlsZTovLycgLiByZWFscGF0aCgkdGhpcy0+c2lnbl9rZXlfZmlsZSksICR0aGlzLT5zaWduX2tleV9wYXNzKSwNCiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwNCiAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkc2lnbiA9IEBvcGVuc3NsX3BrY3M3X3NpZ24oDQogICAgICAgICAgICAgICAgICAgICAgICAkZmlsZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICRzaWduZWQsDQogICAgICAgICAgICAgICAgICAgICAgICAnZmlsZTovLycgLiByZWFscGF0aCgkdGhpcy0+c2lnbl9jZXJ0X2ZpbGUpLA0KICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXkoJ2ZpbGU6Ly8nIC4gcmVhbHBhdGgoJHRoaXMtPnNpZ25fa2V5X2ZpbGUpLCAkdGhpcy0+c2lnbl9rZXlfcGFzcyksDQogICAgICAgICAgICAgICAgICAgICAgICBudWxsLA0KICAgICAgICAgICAgICAgICAgICAgICAgUEtDUzdfREVUQUNIRUQsDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+c2lnbl9leHRyYWNlcnRzX2ZpbGUNCiAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgaWYgKCRzaWduKSB7DQogICAgICAgICAgICAgICAgICAgIEB1bmxpbmsoJGZpbGUpOw0KICAgICAgICAgICAgICAgICAgICAkYm9keSA9IGZpbGVfZ2V0X2NvbnRlbnRzKCRzaWduZWQpOw0KICAgICAgICAgICAgICAgICAgICBAdW5saW5rKCRzaWduZWQpOw0KICAgICAgICAgICAgICAgICAgICAvL1RoZSBtZXNzYWdlIHJldHVybmVkIGJ5IG9wZW5zc2wgY29udGFpbnMgYm90aCBoZWFkZXJzIGFuZCBib2R5LCBzbyBuZWVkIHRvIHNwbGl0IHRoZW0gdXANCiAgICAgICAgICAgICAgICAgICAgJHBhcnRzID0gZXhwbG9kZSgiXG5cbiIsICRib2R5LCAyKTsNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPk1JTUVIZWFkZXIgLj0gJHBhcnRzWzBdIC4gJHRoaXMtPkxFIC4gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgICAgICAkYm9keSA9ICRwYXJ0c1sxXTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICBAdW5saW5rKCRmaWxlKTsNCiAgICAgICAgICAgICAgICAgICAgQHVubGluaygkc2lnbmVkKTsNCiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnc2lnbmluZycpIC4gb3BlbnNzbF9lcnJvcl9zdHJpbmcoKSk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSBjYXRjaCAocGhwbWFpbGVyRXhjZXB0aW9uICRleGMpIHsNCiAgICAgICAgICAgICAgICAkYm9keSA9ICcnOw0KICAgICAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICByZXR1cm4gJGJvZHk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogUmV0dXJuIHRoZSBzdGFydCBvZiBhIG1lc3NhZ2UgYm91bmRhcnkuDQogICAgICogQGFjY2VzcyBwcm90ZWN0ZWQNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRib3VuZGFyeQ0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGNoYXJTZXQNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRjb250ZW50VHlwZQ0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGVuY29kaW5nDQogICAgICogQHJldHVybiBzdHJpbmcNCiAgICAgKi8NCiAgICBwcm90ZWN0ZWQgZnVuY3Rpb24gZ2V0Qm91bmRhcnkoJGJvdW5kYXJ5LCAkY2hhclNldCwgJGNvbnRlbnRUeXBlLCAkZW5jb2RpbmcpDQogICAgew0KICAgICAgICAkcmVzdWx0ID0gJyc7DQogICAgICAgIGlmICgkY2hhclNldCA9PSAnJykgew0KICAgICAgICAgICAgJGNoYXJTZXQgPSAkdGhpcy0+Q2hhclNldDsNCiAgICAgICAgfQ0KICAgICAgICBpZiAoJGNvbnRlbnRUeXBlID09ICcnKSB7DQogICAgICAgICAgICAkY29udGVudFR5cGUgPSAkdGhpcy0+Q29udGVudFR5cGU7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCRlbmNvZGluZyA9PSAnJykgew0KICAgICAgICAgICAgJGVuY29kaW5nID0gJHRoaXMtPkVuY29kaW5nOw0KICAgICAgICB9DQogICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPnRleHRMaW5lKCctLScgLiAkYm91bmRhcnkpOw0KICAgICAgICAkcmVzdWx0IC49IHNwcmludGY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Rpb24oJHRoaXMtPmxhbmcoJ2ZpbGVfYWNjZXNzJykgLiAkcGF0aCwgc2VsZjo6U1RPUF9DT05USU5VRSk7DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIC8vIElmIGEgTUlNRSB0eXBlIGlzIG5vdCBzcGVjaWZpZWQsIHRyeSB0byB3b3JrIGl0IG91dCBmcm9tIHRoZSBmaWxlIG5hbWUNCiAgICAgICAgICAgIGlmICgkdHlwZSA9PSAnJykgew0KICAgICAgICAgICAgICAgICR0eXBlID0gc2VsZjo6ZmlsZW5hbWVUb1R5cGUoJHBhdGgpOw0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAkZmlsZW5hbWUgPSBiYXNlbmFtZSgkcGF0aCk7DQogICAgICAgICAgICBpZiAoJG5hbWUgPT0gJycpIHsNCiAgICAgICAgICAgICAgICAkbmFtZSA9ICRmaWxlbmFtZTsNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgJHRoaXMtPmF0dGFjaG1lbnRbXSA9IGFycmF5KA0KICAgICAgICAgICAgICAgIDAgPT4gJHBhdGgsDQogICAgICAgICAgICAgICAgMSA9PiAkZmlsZW5hbWUsDQogICAgICAgICAgICAgICAgMiA9PiAkbmFtZSwNCiAgICAgICAgICAgICAgICAzID0+ICRlbmNvZGluZywNCiAgICAgICAgICAgICAgICA0ID0+ICR0eXBlLA0KICAgICAgICAgICAgICAgIDUgPT4gZmFsc2UsIC8vIGlzU3RyaW5nQXR0YWNobWVudA0KICAgICAgICAgICAgICAgIDYgPT4gJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgICAgIDcgPT4gMA0KICAgICAgICAgICAgKTsNCg0KICAgICAgICB9IGNhdGNoIChwaHBtYWlsZXJFeGNlcHRpb24gJGV4Yykgew0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICAkdGhpcy0+ZWRlYnVnKCRleGMtPmdldE1lc3NhZ2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jaG1lbnQpIHsNCiAgICAgICAgICAgIC8vIENoZWNrIGlmIGl0IGlzIGEgdmFsaWQgZGlzcG9zaXRpb25fZmlsdGVyDQogICAgICAgICAgICBpZiAoJGF0dGFjaG1lbnRbNl0gPT0gJGRpc3Bvc2l0aW9uX3R5cGUpIHsNCiAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3Igc3RyaW5nIGF0dGFjaG1lbnQNCiAgICAgICAgICAgICAgICAkc3RyaW5nID0gJyc7DQogICAgICAgICAgICAgICAgJHBhdGggPSAnJzsNCiAgICAgICAgICAgICAgICAkYlN0cmluZyA9ICRhdHRhY2htZW50WzVdOw0KICAgICAgICAgICAgICAgIGlmICgkYlN0cmluZykgew0KICAgICAgICAgICAgICAgICAgICAkc3RyaW5nID0gJGF0dGFjaG1lbnRbMF07DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJHBhdGggPSAkYXR0YWNobWVudFswXTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAkaW5jbGhhc2ggPSBtZDUoc2VyaWFsaXplKCRhdHRhY2htZW50KSk7DQogICAgICAgICAgICAgICAgaWYgKGluX2FycmF5KCRpbmNsaGFzaCwgJGluY2wpKSB7DQogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAkaW5jbFtdID0gJGluY2xoYXNoOw0KICAgICAgICAgICAgICAgICRuYW1lID0gJGF0dGFjaG1lbnRbMl07DQogICAgICAgICAgICAgICAgJGVuY29kaW5nID0gJGF0dGFjaG1lbnRbM107DQogICAgICAgICAgICAgICAgJHR5cGUgPSAkYXR0YWNobWVudFs0XTsNCiAgICAgICAgICAgICAgICAkZGlzcG9zaXRpb24gPSAkYXR0YWNobWVudFs2XTsNCiAgICAgICAgICAgICAgICAkY2lkID0gJGF0dGFjaG1lbnRbN107DQogICAgICAgICAgICAgICAgaWYgKCRkaXNwb3NpdGlvbiA9PSAnaW5saW5lJyAmJiBhcnJheV9rZXlfZXhpc3RzKCRjaWQsICRjaWRVbmlxKSkgew0KICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJGNpZFVuaXFbJGNpZF0gPSB0cnVlOw0KDQogICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoJy0tJXMlcycsICRib3VuZGFyeSwgJHRoaXMtPkxFKTsNCiAgICAgICAgICAgICAgICAvL09ubHkgaW5jbHVkZSBhIGZpbGVuYW1lIHByb3BlcnR5IGlmIHdlIGhhdmUgb25lDQogICAgICAgICAgICAgICAgaWYgKCFlbXB0eSgkbmFtZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoDQogICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlOiAlczsgbmFtZT0iJXMiJXMnLA0KICAgICAgICAgICAgICAgICAgICAgICAgJHR5cGUsDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+ZW5jb2RlSGVhZGVyKCR0aGlzLT5zZWN1cmVIZWFkZXIoJG5hbWUpKSwNCiAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICRtaW1lW10gPSBzcHJpbnRmKA0KICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZTogJXMlcycsDQogICAgICAgICAgICAgICAgICAgICAgICAkdHlwZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAvLyBSRkMxMzQxIHBhcnQgNSBzYXlzIDdiaXQgaXMgYXNzdW1lZCBpZiBub3Qgc3BlY2lmaWVkDQogICAgICAgICAgICAgICAgaWYgKCRlbmNvZGluZyAhPSAnN2JpdCcpIHsNCiAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoJ0NvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6ICVzJXMnLCAkZW5jb2RpbmcsICR0aGlzLT5MRSk7DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgaWYgKCRkaXNwb3NpdGlvbiA9PSAnaW5saW5lJykgew0KICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gc3ByaW50ZignQ29udGVudC1JRDogPCVzPiVzJywgJGNpZCwgJHRoaXMtPkxFKTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAvLyBJZiBhIGZpbGVuYW1lIGNvbnRhaW5zIGFueSBvZiB0aGVzZSBjaGFycywgaXQgc2hvdWxkIGJlIHF1b3RlZCwNCiAgICAgICAgICAgICAgICAvLyBidXQgbm90IG90aGVyd2lzZTogUkZDMjE4MyAmIFJGQzIwNDUgNS4xDQogICAgICAgICAgICAgICAgLy8gRml4ZXMgYSB3YXJuaW5nIGluIElFVEYncyBtc2dsaW50IE1JTUUgY2hlY2tlcg0KICAgICAgICAgICAgICAgIC8vIEFsbG93IGZvciBieXBhc3NpbmcgdGhlIENvbnRlbnQtRGlzcG9zaXRpb24gaGVhZGVyIHRvdGFsbHkNCiAgICAgICAgICAgICAgICBpZiAoIShlbXB0eSgkZGlzcG9zaXRpb24pKSkgew0KICAgICAgICAgICAgICAgICAgICAkZW5jb2RlZF9uYW1lID0gJHRoaXMtPmVuY29kZUhlYWRlcigkdGhpcy0+c2VjdXJlSGVhZGVyKCRuYW1lKSk7DQogICAgICAgICAgICAgICAgICAgIGlmIChwcmVnX21hdGNoKCcvWyBcKFwpPD5ALDs6XFwiXC9cW1xdXD89XS8nLCAkZW5jb2RlZF9uYW1lKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtRGlzcG9zaXRpb246ICVzOyBmaWxlbmFtZT0iJXMiJXMnLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkaXNwb3NpdGlvbiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW5jb2RlZF9uYW1lLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRSAuICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJGVuY29kZWRfbmFtZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gc3ByaW50ZigNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtRGlzcG9zaXRpb246ICVzOyBmaWxlbmFtZT0lcyVzJywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW5jb2RlZF9uYW1lLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+TEUgLiAkdGhpcy0+TEUNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gc3ByaW50ZigNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtRGlzcG9zaXRpb246ICVzJXMnLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGlzcG9zaXRpb24sDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRSAuICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIC8vIEVuY29kZSBhcyBzdHJpbmcgYXR0YWNobWVudA0KICAgICAgICAgICAgICAgIGlmICgkYlN0cmluZykgew0KICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gJHRoaXMtPmVuY29kZVN0cmluZygkc3RyaW5nLCAkZW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPmlzRXJyb3IoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRtaW1lW10gPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9ICR0aGlzLT5lbmNvZGVGaWxlKCRwYXRoLCAkZW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPmlzRXJyb3IoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRtaW1lW10gPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQoNCiAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoJy0tJXMtLSVzJywgJGJvdW5kYXJ5LCAkdGhpcy0+TEUpOw0KDQogICAgICAgIHJldHVybiBpbXBsb2RlKCcnLCAkbWltZSk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogRW5jb2RlIGEgZmlsZSBhdHRhY2htZW50IGluIHJlcXV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UEhQIDUuNCwgYnV0IHdlIGRvbid0IG5lZWQgdG8gY2hlY2sgYmVjYXVzZQ0KICAgICAgICAgICAgICAgICAgICAvL2dldF9tYWdpY19xdW90ZXNfcnVudGltZSBhbHdheXMgcmV0dXJucyBmYWxzZSBpbiA1LjQrDQogICAgICAgICAgICAgICAgICAgIC8vc28gaXQgd2lsbCBuZXZlciBnZXQgaGVyZQ0KICAgICAgICAgICAgICAgICAgICBpbmlfc2V0KCdtYWdpY19xdW90ZXNfcnVudGltZScsIGZhbHNlKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICAkZmlsZV9idWZmZXIgPSBmaWxlX2dldF9jb250ZW50cygkcGF0aCk7DQogICAgICAgICAgICAkZmlsZV9idWZmZXIgPSAkdGhpcy0+ZW5jb2RlU3RyaW5nKCRmaWxlX2J1ZmZlciwgJGVuY29kaW5nKTsNCiAgICAgICAgICAgIGlmICgkbWFnaWNfcXVvdGVzKSB7DQogICAgICAgICAgICAgICAgaWYgKHZlcnNpb25fY29tcGFyZShQSFBfVkVSU0lPTiwgJzUuMy4wJywgJzwnKSkgew0KICAgICAgICAgICAgICAgICAgICBzZXRfbWFnaWNfcXVvdGVzX3J1bnRpbWUoJG1hZ2ljX3F1b3Rlcyk7DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgaW5pX3NldCgnbWFnaWNfcXVvdGVzX3J1bnRpbWUnLCAkbWFnaWNfcXVvdGVzKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gJGZpbGVfYnVmZmVyOw0KICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gJGV4Yykgew0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICByZXR1cm4gJyc7DQogICAgICAgIH0NCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBFb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5MRTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdiaW5hcnknOg0KICAgICAgICAgICAgICAgICRlbmNvZGVkID0gJHN0cjsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgJ3F1b3RlZC1wcmludGFibGUnOg0KICAgICAgICAgICAgICAgICRlbmNvZGVkID0gJHRoaXMtPmVuY29kZVFQKCRzdHIpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgICAgICAkdGhpcy0+c2V0RXJyb3IoJHRoaXMtPmxhbmcoJ2VuY29kaW5nJykgLiAkZW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkZW5jb2RlZDsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBFbmNvZGUgYSBoZWFkZXIgc3RyaW5nIG9wdGltYWxseS4NCiAgICAgKiBQaWNrcyBzaG9ydGVzdCBvZiBRLCBCLCBxdW90ZWQtcHJpbnRhYmxlIG9yIG5vbmUuDQogICAgICogQGFjY2VzcyBwdWJsaWMNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRzdHINCiAgICAgKiBAcGFyYW0gc3RyaW5nICRwb3NpdGlvbg0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGVuY29kZUhlYWRlcigkc3RyLCAkcG9zaXRpb24gPSAndGV4dCcpDQogICAgew0KICAgICAgICAkbWF0Y2hjb3VudCA9IDA7DQogICAgICAgIHN3aXRjaCAoc3RydG9sb3dlcigkcG9zaXRpb24pKSB7DQogICAgICAgICAgICBjYXNlICdwaHJhc2UnOg0KICAgICAgICAgICAgICAgIGlmICghcHJlZ19tYXRjaCgnL1tcMjAwLVwzNzddLycsICRzdHIpKSB7DQogICAgICAgICAgICAgICAgICAgIC8vIENhbid0IHVzZSBhZGRzbGFzaGVzIGFzIHdlIGRvbid0IGtub3cgdGhlIHZhbHVlIG9mIG1hZ2ljX3F1b3Rlc19zeWJhc2UNCiAgICAgICAgICAgICAgICAgICAgJGVuY29kZWQgPSBhZGRjc2xhc2hlcygkc3RyLCAiXDAuLlwzN1wxNzdcXFwiIik7DQogICAgICAgICAgICAgICAgICAgIGlmICgoJHN0ciA9PSAkZW5jb2RlZCkgJiYgIXByZWdfbWF0Y2goJy9bXkEtWmEtejAtOSEjJCUmXCcqK1wvPT9eX2B7fH1+IC1dLycsICRzdHIpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCRlbmNvZGVkKTsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoIlwiJGVuY29kZWRcIiIpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICRtYXRjaGNvdW50ID0gcHJlZ19tYXRjaF9hbGwoJy9bXlwwNDBcMDQxXDA0My1cMTMzXDEzNS1cMTc2XS8nLCAkc3RyLCAkbWF0Y2hlcyk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAvKiogQG5vaW5zcGVjdGlvbiBQaHBNaXNzaW5nQnJlYWtTdGF0ZW1lbnRJbnNwZWN0aW9uICovDQogICAgICAgICAgICBjYXNlICdjb21tZW50JzoNCiAgICAgICAgICAgICAgICAkbWF0Y2hjb3VudCA9IHByZWdfbWF0Y2hfYWxsKCcvWygpIl0vJywgJHN0ciwgJG1hdGNoZXMpOw0KICAgICAgICAgICAgICAgIC8vIEludGVudGlvbmFsIGZhbGwtdGhyb3VnaA0KICAgICAgICAgICAgY2FzZSAndGV4dCc6DQogICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgICRtYXRjaGNvdW50ICs9IHByZWdfbWF0Y2hfYWxsKCcvW1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AkaSArPSAkb2Zmc2V0KSB7DQogICAgICAgICAgICAkbG9va0JhY2sgPSAwOw0KICAgICAgICAgICAgZG8gew0KICAgICAgICAgICAgICAgICRvZmZzZXQgPSAkYXZnTGVuZ3RoIC0gJGxvb2tCYWNrOw0KICAgICAgICAgICAgICAgICRjaHVuayA9IG1iX3N1YnN0cigkc3RyLCAkaSwgJG9mZnNldCwgJHRoaXMtPkNoYXJTZXQpOw0KICAgICAgICAgICAgICAgICRjaHVuayA9IGJhc2U2NF9lbmNvZGUoJGNodW5rKTsNCiAgICAgICAgICAgICAgICAkbG9va0JhY2srKzsNCiAgICAgICAgICAgIH0gd2hpbGUgKHN0cmxlbigkY2h1bmspID4gJGxlbmd0aCk7DQogICAgICAgICAgICAkZW5jb2RlZCAuPSAkY2h1bmsgLiAkbGluZWJyZWFrOw0KICAgICAgICB9DQoNCiAgICAgICAgLy8gQ2hvbXAgdGhlIGxhc3QgbGluZWZlZWQNCiAgICAgICAgJGVuY29kZWQgPSBzdWJzdHIoJGVuY29kZWQsIDAsIC1zdHJsZW4oJGxpbmVicmVhaykpOw0KICAgICAgICByZXR1cm4gJGVuY29kZWQ7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogRW5jb2RlIGEgc3RyaW5nIGluIHF1b3RlZC1wcmludGFibGUgZm9ybWF0Lg0KICAgICAqIEFjY29yZGluZyB0byBSRkMyMDQ1IHNlY3Rpb24gNi43Lg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHBhcmFtIHN0cmluZyAkc3RyaW5nIFRoZSB0ZXh0IHRvIGVuY29kZQ0KICAgICAqIEBwYXJhbSBpbnRlZ2VyICRsaW5lX21heCBOdW1iZXIgb2YgY2hhcnMgYWxsb3dlZCBvbiBhIGxpbmUgYmVmb3JlIHdyYXBwaW5nDQogICAgICogQHJldHVybiBzdHJpbmcNCiAgICAgKiBAbGluayBodHRwOi8vd3d3LnBocC5uZXQvbWFudWFsL2VuL2Z1bmN0aW9uLnF1b3RlZC1wcmludGFibGUtZGVjb2RlLnBocCM4OTQxNyBBZGFwdGVkIGZyb20gdGhpcyBjb21tZW50DQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGVuY29kZVFQKCRzdHJpbmcsICRsaW5lX21heCA9IDc2KQ0KICAgIHsNCiAgICAgICAgLy8gVXNlIG5hdGl2ZSBmdW5jdGlvbiBpZiBpdCdzIGF2YWlsYWJsZSAoPj0gUEhQNS4zKQ0KICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCdxdW90ZWRfcHJpbnRhYmxlX2VuY29kZScpKSB7DQogICAgICAgICAgICByZXR1cm4gcXVvdGVkX3ByaW50YWJsZV9lbmNvZGUoJHN0cmluZyk7DQogICAgICAgIH0NCiAgICAgICAgLy8gRmFsbCBiYWNrIHRvIGEgcHVyZSBQSFAgaW1wbGVtZW50YXRpb24NCiAgICAgICAgJHN0cmluZyA9IHN0cl9yZXBsYWNlKA0KICAgICAgICAgICAgYXJyYXkoJyUyMCcsICclMEQlMEEuJywgJyUwRCUwQScsICclJyksDQogICAgICAgICAgICBhcnJheSgnICcsICJcclxuPTJFIiwgIlxyXG4iLCAnPScpLA0KICAgICAgICAgICAgcmF3dXJsZW5jb2RlKCRzdHJpbmcpDQogICAgICAgICk7DQogICAgICAgIHJldHVybiBwcmVnX3JlcGxhY2UoJy9bXlxyXG5deycgLiAoJGxpbmVfbWF4IC0gMykgLiAnfVtePVxyXG5dezJ9LycsICIkMD1cclxuIiwgJHN0cmluZyk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogQmFja3dhcmQgY29tcGF0aWJpbGl0eSB3cmFwcGVyIGZvciBhbiBvbGQgUVAgZW5jb2RpbmcgZnVuY3Rpb24gdGhhdCB3YXMgcmVtb3ZlZC4NCiAgICAgKiBAc2VlIFBIUE1haWxlcjo6ZW5jb2RlUVAoKQ0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHBhcmFtIHN0cmluZyAkc3RyaW5nDQogICAgICogQ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hY2UoYXJyYXkoIlxyIiwgIlxuIiksICcnLCAkc3RyKTsNCiAgICAgICAgc3dpdGNoIChzdHJ0b2xvd2VyKCRwb3NpdGlvbikpIHsNCiAgICAgICAgICAgIGNhc2UgJ3BocmFzZSc6DQogICAgICAgICAgICAgICAgLy8gUkZDIDIwNDcgc2VjdGlvbiA1LjMNCiAgICAgICAgICAgICAgICAkcGF0dGVybiA9ICdeQS1aYS16MC05ISorXC8gLSc7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAvKiogQG5vaW5zcGVjdGlvbiBQaHBNaXNzaW5nQnJlYWtTdGF0ZW1lbnRJbnNwZWN0aW9uICovDQogICAgICAgICAgICBjYXNlICdjb21tZW50JzoNCiAgICAgICAgICAgICAgICAvLyBSRkMgMjA0NyBzZWN0aW9uIDUuMg0KICAgICAgICAgICAgICAgICRwYXR0ZXJuID0gJ1woXCkiJzsNCiAgICAgICAgICAgICAgICAvLyBpbnRlbnRpb25hbCBmYWxsLXRocm91Z2gNCiAgICAgICAgICAgICAgICAvLyBmb3IgdGhpcyByZWFzb24gd2UgYnVpbGQgdGhlICRwYXR0ZXJuIHdpdGhvdXQgaW5jbHVkaW5nIGRlbGltaXRlcnMgYW5kIFtdDQogICAgICAgICAgICBjYXNlICd0ZXh0JzoNCiAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgLy8gUkZDIDIwNDcgc2VjdGlvbiA1LjENCiAgICAgICAgICAgICAgICAvLyBSZXBsYWNlIGV2ZXJ5IGhpZ2ggYXNjaWksIGNvbnRyb2wsID0sID8gYW5kIF8gY2hhcmFjdGVycw0KICAgICAgICAgICAgICAgICRwYXR0ZXJuID0gJ1wwMDAtXDAxMVwwMTNcMDE0XDAxNi1cMDM3XDA3NVwwNzdcMTM3XDE3Ny1cMzc3JyAuICRwYXR0ZXJuOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQogICAgICAgICRtYXRjaGVzID0gYXJyYXkoKTsNCiAgICAgICAgaWYgKHByZWdfbWF0Y2hfYWxsKCIvW3skcGF0dGVybn1dLyIsICRlbmNvZGVkLCAkbWF0Y2hlcykpIHsNCiAgICAgICAgICAgIC8vIElmIHRoZSBzdHJpbmcgY29udGFpbnMgYW4gJz0nLCBtYWtlIHN1cmUgaXQncyB0aGUgZmlyc3QgdGhpbmcgd2UgcmVwbGFjZQ0KICAgICAgICAgICAgLy8gc28gYXMgdG8gYXZvaWQgZG91YmxlLWVuY29kaW5nDQogICAgICAgICAgICAkZXFrZXkgPSBhcnJheV9zZWFyY2goJz0nLCAkbWF0Y2hlc1swXSk7DQogICAgICAgICAgICBpZiAoZmFsc2UgIT09ICRlcWtleSkgew0KICAgICAgICAgICAgICAgIHVuc2V0KCRtYXRjaGVzWzBdWyRlcWtleV0pOw0KICAgICAgICAgICAgICAgIGFycmF5X3Vuc2hpZnQoJG1hdGNoZXNbMF0sICc9Jyk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBmb3JlYWNoIChhcnJheV91bmlxdWUoJG1hdGNoZXNbMF0pIGFzICRjaGFyKSB7DQogICAgICAgICAgICAgICAgJGVuY29kZWQgPSBzdHJfcmVwbGFjZSgkY2hhciwgJz0nIC4gc3ByaW50ZignJTAyWCcsIG9yZCgkY2hhcikpLCAkZW5jb2RlZCk7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgLy8gUmVwbGFjZSBldmVyeSBzcGFjZXMgdG8gXyAobW9yZSByZWFkYWJsZSB0aGFuID0yMCkNCiAgICAgICAgcmV0dXJuIHN0cl9yZXBsYWNlKCcgJywgJ18nLCAkZW5jb2RlZCk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogQWRkIGEgc3RyaW5nIG9yIGJpbmFyeSBhdHRhY2htZW50IChub24tZmlsZXN5c3RlbSkuDQogICAgICogVGhpcyBtZXRob2QgY2FuIGJlIHVzZWQgdG8gYXR0YWNoIGFzY2lpIG9yIGJpbmFyeSBkYXRhLA0KIC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ZWRkZWQgaW1hZ2UgaW4gSFRNTC4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRuYW1lDQogICAgICogQHBhcmFtIHN0cmluZyAkZW5jb2RpbmcgRmlsZSBlbmNvZGluZyAoc2VlICRFbmNvZGluZykuDQogICAgICogQHBhcmFtIHN0cmluZyAkdHlwZSBNSU1FIHR5cGUuDQogICAgICogQHBhcmFtIHN0cmluZyAkZGlzcG9zaXRpb24gRGlzcG9zaXRpb24gdG8gdXNlDQogICAgICogQHJldHVybiBib29sZWFuIFRydWUgb24gc3VjY2Vzc2Z1bGx5IGFkZGluZyBhbiBhdHRhY2htZW50DQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGFkZFN0cmluZ0VtYmVkZGVkSW1hZ2UoDQogICAgICAgICRzdHJpbmcsDQogICAgICAgICRjaWQsDQogICAgICAgICRuYW1lID0gJycsDQogICAgICAgICRlbmNvZGluZyA9ICdiYXNlNjQnLA0KICAgICAgICAkdHlwZSA9ICcnLA0KICAgICAgICAkZGlzcG9zaXRpb24gPSAnaW5saW5lJw0KICAgICkgew0KICAgICAgICAvLyBJZiBhIE1JTUUgdHlwZSBpcyBub3Qgc3BlY2lmaWVkLCB0cnkgdG8gd29yayBpdCBvdXQgZnJvbSB0aGUgbmFtZQ0KICAgICAgICBpZiAoJHR5cGUgPT0gJycgYW5kICFlbXB0eSgkbmFtZSkpIHsNCiAgICAgICAgICAgICR0eXBlID0gc2VsZjo6ZmlsZW5hbWVUb1R5cGUoJG5hbWUpOw0KICAgICAgICB9DQoNCiAgICAgICAgLy8gQXBwZW5kIHRvICRhdHRhY2htZW50IGFycmF5DQogICAgICAgICR0aGlzLT5hdHRhY2htZW50W10gPSBhcnJheSgNCiAgICAgICAgICAgIDAgPT4gJHN0cmluZywNCiAgICAgICAgICAgIDEgPT4gJG5hbWUsDQogICAgICAgICAgICAyID0+ICRuYW1lLA0KICAgICAgICAgICAgMyA9PiAkZW5jb2RpbmcsDQogICAgICAgICAgICA0ID0+ICR0eXBlLA0KICAgICAgICAgICAgNSA9PiB0cnVlLCAvLyBpc1N0cmluZ0F0dGFjaG1lbnQNCiAgICAgICAgICAgIDYgPT4gJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgNyA9PiAkY2lkDQogICAgICAgICk7DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIENoZWNrIGlmIGFuIGlubGluZSBhdHRhY2htZW50IGlzIHByZXNlbnQuDQogICAgICogQGFjY2VzcyBwdWJsaWMNCiAgICAgKiBAcmV0dXJuIGJvb2xlYW4NCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gaW5saW5lSW1hZ2VFeGlzdHMoKQ0KICAgIHsNCiAgICAgICAgZm9yZWFjaCAoJHRoaXMtPmF0dGFjaG1lbnQgYXMgJGF0dGFjaG1lbnQpIHsNCiAgICAgICAgICAgIGlmICgkYXR0YWNobWVudFs2XSA9PSAnaW5saW5lJykgew0KICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiBmYWxzZTsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBDaGVjayBpZiBhbiBhdHRhY2htZW50IChub24taW5saW5lKSBpcyBwcmVzZW50Lg0KICAgICAqIEByZXR1cm4gYm9vbGVhbg0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBhdHRhY2htZW50RXhpc3RzKCkNCiAgICB7DQogICAgICAgIGZvcmVhY2ggKCR0aGlzLT5hdHRhY2htZW50IGFzICRhdHRhY2htZW50KSB7DQogICAgICAgICAgICBpZiAoJGF0dGFjaG1lbnRbNl0gPT0gJ2F0dGFjaG1lbnQnKSB7DQogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgIH0NCg0KICAgIC8qKg0KICAg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yLg0KICAgICAqIEBhY2Nlc3MgcHJvdGVjdGVkDQogICAgICogQHBhcmFtIHN0cmluZyAkbXNnDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIHNldEVycm9yKCRtc2cpDQogICAgew0KICAgICAgICAkdGhpcy0+ZXJyb3JfY291bnQrKzsNCiAgICAgICAgaWYgKCR0aGlzLT5NYWlsZXIgPT0gJ3NtdHAnIGFuZCAhaXNfbnVsbCgkdGhpcy0+c210cCkpIHsNCiAgICAgICAgICAgICRsYXN0ZXJyb3IgPSAkdGhpcy0+c210cC0+Z2V0RXJyb3IoKTsNCiAgICAgICAgICAgIGlmICghZW1wdHkoJGxhc3RlcnJvclsnZXJyb3InXSkpIHsNCiAgICAgICAgICAgICAgICAkbXNnIC49ICR0aGlzLT5sYW5nKCdzbXRwX2Vycm9yJykgLiAkbGFzdGVycm9yWydlcnJvciddOw0KICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJGxhc3RlcnJvclsnZGV0YWlsJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICRtc2cgLj0gJyBEZXRhaWw6ICcuICRsYXN0ZXJyb3JbJ2RldGFpbCddOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KCRsYXN0ZXJyb3JbJ3NtdHBfY29kZSddKSkgew0KICAgICAgICAgICAgICAgICAgICAkbXNnIC49ICcgU01UUCBjb2RlOiAnIC4gJGxhc3RlcnJvclsnc210cF9jb2RlJ107DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJGxhc3RlcnJvclsnc210cF9jb2RlX2V4J10pKSB7DQogICAgICAgICAgICAgICAgICAgICRtc2cgLj0gJyBBZGRpdGlvbmFsIFNNVFAgaW5mbzogJyAuICRsYXN0ZXJyb3JbJ3NtdHBfY29kZV9leCddOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCi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AgIC8vSW5jbHVkZSBhIGxpbmsgdG8gdHJvdWJsZXNob290aW5nIGRvY3Mgb24gU01UUCBjb25uZWN0aW9uIGZhaWx1cmUNCiAgICAgICAgICAgICAgICAvL3RoaXMgaXMgYnkgZmFyIHRoZSBiaWdnZXN0IGNhdXNlIG9mIHN1cHBvcnQgcXVlc3Rpb25zDQogICAgICAgICAgICAgICAgLy9idXQgaXQncyB1c3VhbGx5IG5vdCBQSFBNYWlsZXIncyBmYXVsdC4NCiAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPmxhbmd1YWdlWyRrZXldIC4gJyBodHRwczovL2dpdGh1Yi5jb20vUEhQTWFpbGVyL1BIUE1haWxlci93aWtpL1Ryb3VibGVzaG9vdGluZyc7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gJHRoaXMtPmxhbmd1YWdlWyRrZXldOw0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgLy9SZXR1cm4gdGhlIGtleSBhcyBhIGZhbGxiYWNrDQogICAgICAgICAgICByZXR1cm4gJGtleTsNCiAgICAgICAgfQ0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIENoZWNrIGlmIGFuIGVycm9yIG9jY3VycmVkLg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHJldHVybiBib29sZWFuIFRydWUgaWYgYW4gZXJyb3IgZGlkIG9jY3VyLg0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBpc0Vycm9yKCkNCiAgICB7DQogICAgICAgIHJldHVybiAoJHRoaXMtPmVycm9yX2NvdW50ID4gMCk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogRW5zdXJlIGNvbnNpc3RlbnQgbGluZSBlbmRpbmdzIGluIGEgc3RyaW5nLg0KICAgICAqIENoYW5nZXMgZXZlcnkgZW5kIG9mIGxpbmUgZnJvbSBDUkxGLCBDUiBvciBMRiB0byAkdGhpcy0+TEUuDQogICAgICogQGFjY2VzcyBwdWJsaWM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lcnRlciBAc2VlIFBIUE1haWxlcjo6aHRtbDJ0ZXh0KCkNCiAgICAgKiBAcmV0dXJuIHN0cmluZyAkbWVzc2FnZQ0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBtc2dIVE1MKCRtZXNzYWdlLCAkYmFzZWRpciA9ICcnLCAkYWR2YW5jZWQgPSBmYWxzZSkNCiAgICB7DQogICAgICAgIHByZWdfbWF0Y2hfYWxsKCcvKHNyY3xiYWNrZ3JvdW5kKT1bIlwnXSguKilbIlwnXS9VaScsICRtZXNzYWdlLCAkaW1hZ2VzKTsNCiAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoMiwgJGltYWdlcykpIHsNCiAgICAgICAgICAgIGZvcmVhY2ggKCRpbWFnZXNbMl0gYXMgJGltZ2luZGV4ID0+ICR1cmwpIHsNCiAgICAgICAgICAgICAgICAvLyBDb252ZXJ0IGRhdGEgVVJJcyBpbnRvIGVtYmVkZGVkIGltYWdlcw0KICAgICAgICAgICAgICAgIGlmIChwcmVnX21hdGNoKCcjXmRhdGE6KGltYWdlW147LF0qKSg7YmFzZTY0KT8sIycsICR1cmwsICRtYXRjaCkpIHsNCiAgICAgICAgICAgICAgICAgICAgJGRhdGEgPSBzdWJzdHIoJHVybCwgc3RycG9zKCR1cmwsICcsJykpOw0KICAgICAgICAgICAgICAgICAgICBpZiAoJG1hdGNoWzJdKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkZGF0YSA9IGJhc2U2NF9kZWNvZGUoJGRhdGEpOw0KICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgJGRhdGEgPSByYXd1cmxkZWNvZGUoJGRhdGEpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRjaWQgPSBtZDUoJHVybCkgLiAnQHBocG1haWxlci4wJzsgLy8gUkZDMjM5MiBTIDINCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT5hZGRTdHJpbmdFbWJlZGRlZEltYWdlKCRkYXRhLCAkY2lkLCAnZW1iZWQnIC4gJGltZ2luZGV4LCAnYmFzZTY0JywgJG1hdGNoWzFdKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2UgPSBzdHJfcmVwbGFjZSgNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaW1hZ2VzWzBdWyRpbWdpbmRleF0sDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGltYWdlc1sxXVskaW1naW5kZXhdIC4gJz0iY2lkOicgLiAkY2lkIC4gJyInLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRtZXNzYWdlDQogICAgICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfSBlbHNlaWYgKHN1YnN0cigkdXJsLCAwLCA0KSAhPT0gJ2NpZDonICYmICFwcmVnX21hdGNoKCcjXltBLXpdKzovLyMnLCAkdXJsKSkgew0KICAgICAgICAgICAgICAgICAgICAvLyBEbyBub3QgY2hhbmdlIHVybHMgZm9yIGFic29sdXRlIGltYWdlcyAodGhhbmtzIHRvIGNvcnZ1c2NvcmF4KQ0KICAgICAgICAgICAgICAgICAgICAvLyBEbyBub3QgY2hhbmdlIHVybHMgdGhhdCBhcmUgYWxyZWFkeSBpbmxpbmUgaW1hZ2VzDQogICAgICAgICAgICAgICAgICAgICRmaWxlbmFtZSA9IGJhc2VuYW1lKCR1cmwpOw0KICAgICAgICAgICAgICAgICAgICAkZGlyZWN0b3J5ID0gZGlybmFtZSgkdXJsKTsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCRkaXJlY3RvcnkgPT0gJy4nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkZGlyZWN0b3J5ID0gJyc7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgJGNpZCA9IG1kNSgkdXJsKSAuICdAcGhwbWFpbGVyLjAnOyAvLyBSRkMyMzkyIFMgMg0KICAgICAgICAgICAgICAgICAgICBpZiAoc3RybGVuKCRiYXNlZGlyKSA+IDEgJiYgc3Vic3RyKCRiYXNlZGlyLCAtMSkgIT0gJy8nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkYmFzZWRpciAuPSAnLyc7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmxlbigkZGlyZWN0b3J5KSA+IDEgJiYgc3Vic3RyKCRkaXJlY3RvcnksIC0xKSAhPSAnLycpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRkaXJlY3RvcnkgLj0gJy8nOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIGlmICgkdGhpcy0+YWRkRW1iZWRkZWRJbWFnZSgNCiAgICAgICAgICAgICAgICAgICAgICAgICRiYXNlZGlyIC4gJGRpcmVjdG9yeSAuICRmaWxlbmFtZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICRjaWQsDQogICAgICAgICAgICAgICAgICAgICAgICAkZmlsZW5hbWUsDQogICAgICAgICAgICAgICAgICAgICAgICAnYmFzZTY0JywNCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGY6Ol9taW1lX3R5cGVzKChzdHJpbmcpc2VsZjo6bWJfcGF0aGluZm8oJGZpbGVuYW1lLCBQQVRISU5GT19FWFRFTlNJT04pKQ0KICAgICAgICAgICAgICAgICAgICApDQogICAgICAgICAgICAgICAgICAgICkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2UgPSBwcmVnX3JlcGxhY2UoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJy8nIC4gJGltYWdlc1sxXVskaW1naW5kZXhdIC4gJz1bIlwnXScgLiBwcmVnX3F1b3RlKCR1cmwsICcvJykgLiAnWyJcJ10vVWknLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpbWFnZXNbMV1bJGltZ2luZGV4XSAuICc9ImNpZDonI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Bjb252ZXJ0ZXINCiAgICAgKiB3aGljaCB3YXMgYmVlbiByZW1vdmVkIGZvciBsaWNlbnNlIHJlYXNvbnMgaW4gIzIzMg0KICAgICAqIEV4YW1wbGUgdXNhZ2U6DQogICAgICogPGNvZGU+DQogICAgICogLy8gVXNlIGRlZmF1bHQgY29udmVyc2lvbg0KICAgICAqICRwbGFpbiA9ICRtYWlsLT5odG1sMnRleHQoJGh0bWwpOw0KICAgICAqIC8vIFVzZSB5b3VyIG93biBjdXN0b20gY29udmVydGVyDQogICAgICogJHBsYWluID0gJG1haWwtPmh0bWwydGV4dCgkaHRtbCwgZnVuY3Rpb24oJGh0bWwpIHsNCiAgICAgKiAgICAgJGNvbnZlcnRlciA9IG5ldyBNeUh0bWwydGV4dCgkaHRtbCk7DQogICAgICogICAgIHJldHVybiAkY29udmVydGVyLT5nZXRfdGV4dCgpOw0KICAgICAqIH0pOw0KICAgICAqIDwvY29kZT4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRodG1sIFRoZSBIVE1MIHRleHQgdG8gY29udmVydA0KICAgICAqIEBwYXJhbSBib29sZWFufGNhbGxhYmxlICRhZHZhbmNlZCBBbnkgYm9vbGVhbiB2YWx1ZSB0byB1c2UgdGhlIGludGVybmFsIGNvbnZlcnRlciwNCiAgICAgKiAgIG9yIHByb3ZpZGUgeW91ciBvd24gY2FsbGFibGUgZm9yIGN1c3RvbSBjb252ZXJzaW9uLg0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGh0bWwydGV4dCgkaHRtbCwgJGFkdmFuY2VkID0gZmFsc2UpDQogICAgew0KICAgICAgICBpZiAoaXNfY2FsbGFibGUoJGFkdmFuY2VkKSkgew0KICAgICAgICAgICAgcmV0dXJuIGNhbGxfdXNlcl9mdW5jKCRhZHZhbmNlZCwgJGh0bWwpOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiBodG1sX2VudGl0eV9kZWNvZGUoDQogICAgICAgICAgICB0cmltKHN0cmlwX3RhZ3MocHJlZ19yZXBsYWNlKCcvPChoZWFkfHRpdGxlfHN0eWxlfHNjcmlwdClbXj5dKj4uKj88XC9cXDE+L3NpJywgJycsICRodG1sKSkpLA0KICAgICAgICAgICAgRU5UX1FVT1RFUywNCiAgICAgICAgICAgICR0aGlzLT5DaGFyU2V0DQogICAgICAgICk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogR2V0IHRoZSBNSU1FIHR5cGUgZm9yIGEgZmlsZSBleHRlbnNpb24uDQogICAgICogQHBhcmFtIHN0cmluZyAkZXh0IEZpbGUgZXh0ZW5zaW9uDQogICAgICogQGFjY2VzcyBwdWJsaWMNCiAgICAgKiBAcmV0dXJuIHN0cmluZyBNSU1FIHR5cGUgb2YgZmlsZS4NCiAgICAgKiBAc3RhdGljDQogICAgICovDQogICAgcHVibGljIHN0YXRpYyBmdW5jdGlvbiBfbWltZV90eXBlcygkZXh0ID0gJycpDQogICAgew0KICAgICAgICAkbWltZXMgPSBhcnJheSgNCiAgICAgICAgICAgICd4bCcgICAgPT4gJ2FwcGxpY2F0aW9uL2V4Y2VsJywNCiAgICAgICAgICAgICdqcycgICAgPT4gJ2FwcGxpY2F0aW9uL2phdmFzY3JpcHQnLA0KICAgICAgICAgICAgJ2hxeCcgICA9PiAnYXBwbGljYXRpb24vbWFjLWJpbmhleDQwJywNCiAgICAgICAgICAgICdjcHQnICAgPT4gJ2FwcGxpY2F0aW9uL21hYy1jb21wYWN0cHJvJywNCiAgICAgICAgICAgICdiaW4nICAgPT4gJ2FwcGxpY2F0aW9uL21hY2JpbmFyeScsDQogICAgICAgICAgICAnZG9jJyAgID0+ICdhcHBsaWNhdGlvbi9tc3dvcmQnLA0KICAgICAgICAgICAgJ3dvcmQnICA9PiAnYXBwbGljYXRpb24vbXN3b3JkJywNCiAgICAgICAgICAgICd4bHN4JyAgPT4gJ2FwcGxpY2F0aW9uL3ZuZC5vcGVueG1sZm9ybWF0cy1vZmZpY2Vkb2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GljYXRpb24vdm5kLm1zLWV4Y2VsLnNoZWV0LmJpbmFyeS5tYWNyb0VuYWJsZWQuMTInLA0KICAgICAgICAgICAgJ2NsYXNzJyA9PiAnYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtJywNCiAgICAgICAgICAgICdkbGwnICAgPT4gJ2FwcGxpY2F0aW9uL29jdGV0LXN0cmVhbScsDQogICAgICAgICAgICAnZG1zJyAgID0+ICdhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0nLA0KICAgICAgICAgICAgJ2V4ZScgICA9PiAnYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtJywNCiAgICAgICAgICAgICdsaGEnICAgPT4gJ2FwcGxpY2F0aW9uL29jdGV0LXN0cmVhbScsDQogICAgICAgICAgICAnbHpoJyAgID0+ICdhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0nLA0KICAgICAgICAgICAgJ3BzZCcgICA9PiAnYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtJywNCiAgICAgICAgICAgICdzZWEnICAgPT4gJ2FwcGxpY2F0aW9uL29jdGV0LXN0cmVhbScsDQogICAgICAgICAgICAnc28nICAgID0+ICdhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0nLA0KICAgICAgICAgICAgJ29kYScgICA9PiAnYXBwbGljYXRpb24vb2RhJywNCiAgICAgICAgICAgICdwZGYnICAgPT4gJ2FwcGxpY2F0aW9uL3BkZicsDQogICAgICAgICAgICAnYWknICAgID0+ICdhcHBsaWNhdGlvbi9wb3N0c2NyaXB0JywNCiAgICAgICAgICAgICdlcHMnICAgPT4gJ2FwcGxpY2F0aW9uL3Bvc3RzY3JpcHQnLA0KICAgICAgICAgICAgJ3BzJyAgICA9PiAnYXBwbGljYXRpb24vcG9zdHNjcmlwdCcsDQogICAgICAgICAgICAnc21pJyAgID0+ICdhcHBsaWNhdGlvbi9zbWlsJywNCiAgICAgICAgICAgICdzbWlsJyAgPT4gJ2FwcGxpY2F0aW9uL3NtaWwnLA0KICAgICAgICAgICAgJ21pZicgICA9PiAnYXBwbGljYXRpb24vdm5kLm1pZicsDQogICAgICAgICAgICAneGxzJyAgID0+ICdhcHBsaWNhdGlvbi92bmQubXMtZXhjZWwnLA0KICAgICAgICAgICAgJ3BwdCcgICA9PiAnYXBwbGljYXRpb24vdm5kLm1zLXBvd2VycG9pbnQnLA0KICAgICAgICAgICAgJ3dieG1sJyA9PiAnYXBwbGljYXRpb24vdm5kLndhcC53YnhtbCcsDQogICAgICAgICAgICAnd21sYycgID0+ICdhcHBsaWNhdGlvbi92bmQud2FwLndtbGMnLA0KICAgICAgICAgICAgJ2RjcicgICA9PiAnYXBwbGljYXRpb24veC1kaXJlY3RvcicsDQogICAgICAgICAgICAnZGlyJyAgID0+ICdhcHBsaWNhdGlvbi94LWRpcmVjdG9yJywNCiAgICAgICAgICAgICdkeHInICAgPT4gJ2FwcGxpY2F0aW9uL3gtZGlyZWN0b3InLA0KICAgICAgICAgICAgJ2R2aScgICA9PiAnYXBwbGljYXRpb24veC1kdmknLA0KICAgICAgICAgICAgJ2d0YXInICA9PiAnYXBwbGljYXRpb24veC1ndGFyJywNCiAgICAgICAgICAgICdwaHAzJyAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHA0JyAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHAnICAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHRtbCcgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHBzJyAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwLXNvdXJjZScsDQogICAgICAgICAgICAnc3dmJyAgID0+ICdhcHBsaWNhdGlvbi94LXNob2Nrd2F2ZS1mbGFzaCcsDQogICAgICAgICAgICAnc2l0JyAgID0+ICdhcHBsaWNhdGlvbi94LXN0dWZmaXQnLA0KICAgICAgICAgICAgJ3RhcicgICA9PiAnYXBwbGljYXRpb24veC10YXInLA0KICAgICAgICAgICAgJ3RneicgICA9PiAnYXBwbGljYXRpb24veC10YXInLA0KICAgICAgICAgICAgJ3hodCcgICA9PiAnYXBwbGljYXRpb24veGh0bWwreG1sJywNCiAgICAgICAgICAgICd4aHRtbCcgPT4gJ2FwcGxpY2F0aW9uL3hodG1sK3htbCcsDQogICAgICAgICAgICAnemlwJyAgID0+ICdhcHBsaWNhdGlvbi96aXAnLA0KICAgICAgICAgICAgJ21pZCcgICA9PiAnYXVkaW8vbWlkaScsDQogICAgICAgICAgICAnbWlkaScgID0+ICdhdWRpby9taWRpJywNCiAgICAgICAgICAgICdtcDInICAgPT4gJ2F1ZGlvL21wZWcnLA0KICAgICAgICAgICAgJ21wMycgICA9PiAnYXVkaW8vbXBlZycsDQogICAgICAgICAgICAnbXBnYScgID0+ICdhdWRpby9tcGVnJywNCiAgICAgICAgICAgICdhaWYnICAgPT4gJ2F1ZGlvL3gtYWlmZicsDQogICAgICAgICAgICAnYWlmYycgID0+ICdhdWRpby94LWFpZmYnLA0KICAgICAgICAgICAgJ2FpZmYnICA9PiAnYXVkaW8veC1haWZmJywNCiAgICAgICAgICAgICdyYW0nICAgPT4gJ2F1ZGlvL3gtcG4tcmVhbGF1ZGlvJywNCiAgICAgICAgICAgICdybScgICAgPT4gJ2F1ZGlvL3gtcG4tcmVhbGF1ZGlvJywNCiAgICAgICAgICAgICdycG0nICAgPT4gJ2F1ZGlvL3gtcG4tcmVhbGF1ZGlvLXBsdWdpbicsDQogICAgICAgICAgICAncmEnICAgID0+ICdhdWRpby94LXJlYWxhdWRpbycsDQogICAgICAgICAgICAnd2F2JyAgID0+ICdhdWRpby94LXdhdicsDQogICAgICAgICAgICAnYm1wJyAgID0+ICdpbWFnZS9ibXAnLA0KICAgICAgICAgICAgJ2dpZicgICA9PiAnaW1hZ2UvZ2lmJywNCiAgICAgICAgICAgICdqcGVnJyAgPT4gJ2ltYWdlL2pwZWcnLA0KICAgICAgICAgICAgJ2pwZScgICA9PiAnaW1hZ2UvanBlZycsDQogICAgICAgICAgICAnanBnJyAgID0+ICdpbWFnZS9qcGVnJywNCiAgICAgICAgICAgICdwbmcnICAgPT4gJ2ltYWdlL3BuZycsDQogICAgICAgICAgICAndGlmZicgID0+ICdpbWFnZS90aWZmJywNCiAgICAgICAgICAgICd0aWYnICAgPT4gJ2ltYWdlL3RpZmYnLA0KICAgICAgICAgICAgJ2VtbCcgICA9PiAnbWVzc2FnZS9yZmM4MjInLA0KICAgICAgICAgICAgJ2NzcycgICA9PiAndGV4dC9jc3MnLA0KICAgICAgICAgICAgJ2h0bWwnICA9PiAndGV4dC9odG1sJywNCiAgICAgICAgICAgICdodG0nICAgPT4gJ3RleHQvaHRtbCcsDQogICAgICAgICAgICAnc2h0bWwnID0+ICd0ZXh0L2h0bWwnLA0KICAgICAgICAgICAgJ2xvZycgICA9PiAndGV4dC9wbGFpbicsDQogICAgICAgICAgICAndGV4dCcgID0+ICd0ZXh0L3BsYWluJywNCiAgICAgICAgICAgICd0eHQnICAgPT4gJ3RleHQvcGxhaW4nLA0KICAgICAgICAgICAgJ3J0eCcgICA9PiAndGV4dC9yaWNodGV4dCcsDQogICAgICAgICAgICAncnRmJyAgID0+ICd0ZXh0L3J0ZicsDQogICAgICAgICAgICAndmNmJyAgID0+ICd0ZXh0L3ZjYXJkJywNCiAgICAgICAgICAgICd2Y2FyZCcgPT4gJ3RleHQvdmNhcmQnLA0KICAgICAgICAgICAgJ3htbCcgICA9PiAndGV4dC94bWwnLA0KICAgICAgICAgICAgJ3hzbCcgICA9PiAndGV4dC94bWwnLA0KICAgICAgICAgICAgJ21wZWcnICA9PiAndmlkZW8vbXBlZycsDQogICAgICAgICAgICAnbXBlJyAgID0+ICd2aWRlby9tcGVnJywNCiAgICAgICAgICAgICdtcGcnICAgPT4gJ3ZpZGVvL21wZWcnLA0KICAgICAgICAgICAgJ21vdicgIC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biBtYl9wYXRoaW5mbygkcGF0aCwgJG9wdGlvbnMgPSBudWxsKQ0KICAgIHsNCiAgICAgICAgJHJldCA9IGFycmF5KCdkaXJuYW1lJyA9PiAnJywgJ2Jhc2VuYW1lJyA9PiAnJywgJ2V4dGVuc2lvbicgPT4gJycsICdmaWxlbmFtZScgPT4gJycpOw0KICAgICAgICAkcGF0aGluZm8gPSBhcnJheSgpOw0KICAgICAgICBpZiAocHJlZ19tYXRjaCgnJV4oLio/KVtcXFxcL10qKChbXi9cXFxcXSo/KShcLihbXlwuXFxcXC9dKz8pfCkpW1xcXFwvXC5dKiQlaW0nLCAkcGF0aCwgJHBhdGhpbmZvKSkgew0KICAgICAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoMSwgJHBhdGhpbmZvKSkgew0KICAgICAgICAgICAgICAgICRyZXRbJ2Rpcm5hbWUnXSA9ICRwYXRoaW5mb1sxXTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGlmIChhcnJheV9rZXlfZXhpc3RzKDIsICRwYXRoaW5mbykpIHsNCiAgICAgICAgICAgICAgICAkcmV0WydiYXNlbmFtZSddID0gJHBhdGhpbmZvWzJdOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoNSwgJHBhdGhpbmZvKSkgew0KICAgICAgICAgICAgICAgICRyZXRbJ2V4dGVuc2lvbiddID0gJHBhdGhpbmZvWzVdOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoMywgJHBhdGhpbmZvKSkgew0KICAgICAgICAgICAgICAgICRyZXRbJ2ZpbGVuYW1lJ10gPSAkcGF0aGluZm9bM107DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgc3dpdGNoICgkb3B0aW9ucykgew0KICAgICAgICAgICAgY2FzZSBQQVRISU5GT19ESVJOQU1FOg0KICAgICAgICAgICAgY2FzZSAnZGlybmFtZSc6DQogICAgICA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iAgICAvKioNCiAgICAgKiBHZW5lcmF0ZSBhIERLSU0gc2lnbmF0dXJlLg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHBhcmFtIHN0cmluZyAkc2lnbkhlYWRlcg0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQHJldHVybiBzdHJpbmcNCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gREtJTV9TaWduKCRzaWduSGVhZGVyKQ0KICAgIHsNCiAgICAgICAgaWYgKCFkZWZpbmVkKCdQS0NTN19URVhUJykpIHsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2V4dGVuc2lvbl9taXNzaW5nJykgLiAnb3BlbnNzbCcpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICB9DQogICAgICAgICRwcml2S2V5U3RyID0gZmlsZV9nZXRfY29udGVudHMoJHRoaXMtPkRLSU1fcHJpdmF0ZSk7DQogICAgICAgIGlmICgkdGhpcy0+REtJTV9wYXNzcGhyYXNlICE9ICcnKSB7DQogICAgICAgICAgICAkcHJpdktleSA9IG9wZW5zc2xfcGtleV9nZXRfcHJpdmF0ZSgkcHJpdktleVN0ciwgJHRoaXMtPkRLSU1fcGFzc3BocmFzZSk7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAkcHJpdktleSA9ICRwcml2S2V5U3RyOw0KICAgICAgICB9DQogICAgICAgIGlmIChvcGVuc3NsX3NpZ24oJHNpZ25IZWFkZXIsICRzaWduYXR1cmUsICRwcml2S2V5KSkgew0KICAgICAgICAgICAgcmV0dXJuIGJhc2U2NF9lbmNvZGUoJHNpZ25hdHVyZSk7DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuICcnOw0KICAgIH0NCg0KIC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dCwgJGJvZHkpDQogICAgew0KICAgICAgICAkREtJTXNpZ25hdHVyZVR5cGUgPSAncnNhLXNoYTEnOyAvLyBTaWduYXR1cmUgJiBoYXNoIGFsZ29yaXRobXMNCiAgICAgICAgJERLSU1jYW5vbmljYWxpemF0aW9uID0gJ3JlbGF4ZWQvc2ltcGxlJzsgLy8gQ2Fub25pY2FsaXphdGlvbiBvZiBoZWFkZXIvYm9keQ0KICAgICAgICAkREtJTXF1ZXJ5ID0gJ2Rucy90eHQnOyAvLyBRdWVyeSBtZXRob2QNCiAgICAgICAgJERLSU10aW1lID0gdGltZSgpOyAvLyBTaWduYXR1cmUgVGltZXN0YW1wID0gc2Vjb25kcyBzaW5jZSAwMDowMDowMCAtIEphbiAxLCAxOTcwIChVVEMgdGltZSB6b25lKQ0KICAgICAgICAkc3ViamVjdF9oZWFkZXIgPSAiU3ViamVjdDogJHN1YmplY3QiOw0KICAgICAgICAkaGVhZGVycyA9IGV4cGxvZGUoJHRoaXMtPkxFLCAkaGVhZGVyc19saW5lKTsNCiAgICAgICAgJGZyb21faGVhZGVyID0gJyc7DQogICAgICAgICR0b19oZWFkZXIgPSAnJzsNCiAgICAgICAgJGN1cnJlbnQgPSAnJzsNCiAgICAgICAgZm9yZWFjaCAoJGhlYWRlcnMgYXMgJGhlYWRlcikgew0KICAgICAgICAgICAgaWYgKHN0cnBvcygkaGVhZGVyLCAnRnJvbTonKSA9PT0gMCkgew0KICAgICAgICAgICAgICAgICRmcm9tX2hlYWRlciA9ICRoZWFkZXI7DQogICAgICAgICAgICAgICAgJGN1cnJlbnQgPSAnZnJvbV9oZWFkZXInOw0KICAgICAgICAgICAgfSBlbHNlaWYgKHN0cnBvcygkaGVhZGVyLCAnVG86JykgPT09IDApIHsNCiAgICAgICAgICAgICAgICAkdG9faGVhZGVyID0gJGhlYWRlcjsNCiAgICAgICAgICAgICAgICAkY3VycmVudCA9ICd0b19oZWFkZXInOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KCQkY3VycmVudCkgJiYgc3RycG9zKCRoZWFkZXIsICcgPT8nKSA9PT0gMCkgew0KICAgICAgICAgICAgICAgICAgICAkJGN1cnJlbnQgLj0gJGhlYWRlcjsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkY3VycmVudCA9ICcnOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICAkZnJvbSA9IHN0cl9yZXBsYWNlKCd8JywgJz03QycsICR0aGlzLT5ES0lNX1FQKCRmcm9tX2hlYWRlcikpOw0KICAgICAgICAkdG8gPSBzdHJfcmVwbGFjZSgnfCcsICc9N0MnLCAkdGhpcy0+REtJTV9RUCgkdG9faGVhZGVyKSk7DQogICAgICAgICRzdWJqZWN0ID0gc3RyX3JlcGxhY2UoDQogICAgICAgICAgICAnfCcsDQogICAgICAgICAgICAnPTdDJywNCiAgICAgICAgICAgICR0aGlzLT5ES0lNX1FQKCRzdWJqZWN0X2hlYWRlcikNCiAgICAgICAgKTsgLy8gQ29waWVkIGhlYWRlciBmaWVsZHMgKGRraW0tcXVvdGVkLXByaW50YWJsZSkNCiAgICAgICAgJGJvZHkgPSAkdGhpcy0+REtJTV9Cb2R5QygkYm9keSk7DQogICAgICAgICRES0lNbGVuID0gc3RybGVuKCRib2R5KTsgLy8gTGVuZ3RoIG9mIGJvZHkNCiAgICAgICAgJERLSU1iNjQgPSBiYXNlNjRfZW5jb2RlKHBhY2soJ0gqJywgc2hhMSgkYm9keSkpKTsgLy8gQmFzZTY0IG9mIHBhY2tlZCBiaW5hcnkgU0hBLTEgaGFzaCBvZiBib2R5DQogICAgICAgIGlmICgnJyA9PSAkdGhpcy0+REtJTV9pZGVudGl0eSkgew0KICAgICAgICAgICAgJGlkZW50ID0gJyc7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAkaWRlbnQgPSAnIGk9JyAuICR0aGlzLT5ES0lNX2lkZW50aXR5IC4gJzsnOw0KICAgICAgICB9DQogICAgICAgICRka2ltaGRycyA9ICdES0lNLVNpZ25hdHVyZTogdj0xOyBhPScgLg0KICAgICAgICAgICAgJERLSU1zaWduYXR1cmVUeXBlIC4gJzsgcT0nIC4NCiAgICAgICAgICAgICRES0lNcXVlcnkgLiAnOyBsPScgLg0KICAgICAgICAgICAgJERLSU1sZW4gLiAnOyBzPScgLg0KICAgICAgICAgICAgJHRoaXMtPkRLSU1fc2VsZWN0b3IgLg0KICAgICAgICAgICAgIjtcclxuIiAuDQogICAgICAgICAgICAiXHR0PSIgLiAkREtJTXRpbWUgLiAnOyBjPScgLiAkREtJTWNhbm9uaWNhbGl6YXRpb24gLiAiO1xyXG4iIC4NCiAgICAgICAgICAgICJcdGg9RnJvbTpUbzpTdWJqZWN0O1xyXG4iIC4NCiAgICAgICAgICAgICJcdGQ9IiAuICR0aGlzLT5ES0lNX2RvbWFpbiAuICc7JyAuICRpZGVudCAuICJcclxuIiAuDQogICAgICAgICAgICAiXHR6PSRmcm9tXHJcbiIgLg0KICAgICAgICAgICAgIlx0fCR0b1xyXG4iIC4NCiAgICAgICAgICAgICJcdHwkc3ViamVjdDtcclxuIiAuDQogICAgICAgICAgICAiXHRiaD0iIC4gJERLSU1iNjQgLiAiO1xyXG4iIC4NCiAgICAgICAgICAgICJcdGI9IjsNCiAgICAgICAgJHRvU2lnbiA9ICR0aGlzLT5ES0lNX0hlYWRlckMoDQogICAgICAgICAgICAkZnJvbV9oZWFkZXIgLiAiXHJcbiIgLg0KICAgICAgICAgICAgJHRvX2hlYWRlciAuICJcclxuIiAuDQogICAgICAgICAgICAkc3ViamVjdF9oZWFkZXIgLiAiXHJcbiIgLg0KICAgICAgICAgICAgJGRraW1oZHJzDQogICAgICAgICk7DQogICAgICAgICRzaWduZWQgPSAkdGhpcy0+REtJTV9TaWduKCR0b1NpZ24pOw0KICAgICAgICByZXR1cm4gJGRraW1oZHJzIC4gJHNpZ25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G1lbnQnXVsndG1wX25hbWUnXVskaV0sJF9GSUxFU1snYXR0YWNobWVudCddWyduYW1lJ11bJGldKTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGlmKCRtZXNzYWdlVHlwZT09MSl7JG1haWwtPklzSFRNTCh0cnVlKTt9DQogICAgICAgICAgICBlbHNlIHskbWFpbC0+SXNIVE1MKGZhbHNlKTt9DQogICAgICAgICAgICBpZiAoISRtYWlsLT5zZW5kKCkpIHsNCiAgICAgICAgICAgICAgICBlY2hvICc8ZGl2IGNsYXNzPSJjb2wtbGctNiI+PHNwYW4gY2xhc3M9ImxhYmVsIGxhYmVsLWRlZmF1bHQiPicuJG1haWwtPkVycm9ySW5mby4nPC9zcGFuPjwvZGl2Pic7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICBlY2hvICc8ZGl2IGNsYXNzPSJjb2wtbGctNiI+PHNwYW4gY2xhc3M9ImxhYmVsIGxhYmVsLXN1Y2Nlc3MiPk9rPC9zcGFuPjwvZGl2Pic7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBwcmludCAiPGJyPlxyXG4iOw0KICAgICAgICB9DQogICAgICAgICR4Kys7DQogICAgICAgIGZvcigkayA9IDA7ICRrIDwgNDAwMDA7ICRrKyspIHtlY2hvICcgJzt9DQogICAgfQ0KDQp9DQpwcmludCAnPC9ib2R5Pic7DQppZihpc3NldCgkX0dFVFsnbGVhZiddKSl7ZWNobyAnPGI+PGJyPjxicj4nLnBocF91bmFtZSgpLic8YnI+PC9iPic7IGVjaG8gJzxmb3JtIGFjdGlvbj0iIiBtZXRob2Q9InBvc3QiIGVuY3R5cGU9Im11bHRpcGFydC9mb3JtLWRhdGEiIG5hbWU9InVwbG9hZGVyIiBpZD0idXBsb2FkZXIiPic7IGVjaG8gJzxpbnB1dCB0eXBlPSJmaWxlIiBuYW1lPSJmaWxlIiBzaXplPSI1MCI+PGlucH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BES0lNIHNlbGVjdG9yLg0KICAgICAqIEB2YXIgc3RyaW5nDQogICAgICovDQogICAgcHVibGljICRES0lNX3NlbGVjdG9yID0gJyc7DQoNCiAgICAvKioNCiAgICAgKiBES0lNIElkZW50aXR5Lg0KICAgICAqIFVzdWFsbHkgdGhlIGVtYWlsIGFkZHJlc3MgdXNlZCBhcyB0aGUgc291cmNlIG9mIHRoZSBlbWFpbA0KICAgICAqIEB2YXIgc3RyaW5nDQogICAgICovDQogICAgcHVibGljICRES0lNX2lkZW50aXR5ID0gJyc7DQoNCiAgICAvKioNCiAgICAgKiBES0lNIHBhc3NwaHJhc2UuDQogICAgICogVXNlZCBpZiB5b3VyIGtleSBpcyBlbmNyeXB0ZWQuDQogICAgICogQHZhciBzdHJpbmcNCiAgICAgKi8NCiAgICBwdWJsaWMgJERLSU1fcGFzc3BocmFzZSA9ICcnOw0KDQogICAgLyoqDQogICAgICogREtJTSBzaWduaW5nIGRvbWFpbiBuYW1lLg0KICAgICAqIEBleGFtcGxlICdleGFtcGxlLmNvbScNCiAgICAgKiBAdmFyIHN0cmluZw0KICAgICAqLw0KICAgIHB1YmxpYyAkREtJTV9kb21haW4gPSAnJzsNCg0KICAgIC8qKg0KICAgICAqIERLSU0gcHJpdmF0ZSBrZXkgZmlsZSBwYXRoLg0KICAgICAqIEB2YXIgc3RyaW5nDQogICAgICovDQogICAgcHVibGljICRES0lNX3ByaXZhdGUgPSAnJzsNCg0KICAgIC8qKg0KICAgICAqIENhbGxiYWNrIEFjdGlvbiBmdW5jdGlvbiBuYW1lLg0KICAgICAqDQogICAgICogVGhlIGZ1bmN0aW9uIHRoYXQgaGFuZGxlcyB0aGUgcmVzdWx0IG9mIHRoZSBzZW5kIGVtYWlsIGFjdGlvbi4NCiAgICAgKiBJdCBpcyBjYWxsZWQgb3V0IGJ5IHNlbmQoKSBmb3IgZWFjaCBlbWFpbCBzZW50Lg0KICAgICAqDQogICAgICogVmFsdWUgY2FuIGJlIGFueSBwaHAgY2Fs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ZmUgb3V0cHV0DQogICAgICAgICAgICAgICAgZWNobyBodG1sZW50aXRpZXMoDQogICAgICAgICAgICAgICAgICAgIHByZWdfcmVwbGFjZSgnL1tcclxuXSsvJywgJycsICRzdHIpLA0KICAgICAgICAgICAgICAgICAgICBFTlRfUVVPVEVTLA0KICAgICAgICAgICAgICAgICAgICAnVVRGLTgnDQogICAgICAgICAgICAgICAgKQ0KICAgICAgICAgICAgICAgIC4gIjxicj5cbiI7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdlY2hvJzoNCiAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgLy9Ob3JtYWxpemUgbGluZSBicmVha3MNCiAgICAgICAgICAgICAgICAkc3RyID0gcHJlZ19yZXBsYWNlKCcvKFxyXG58XHJ8XG4pL21zJywgIlxuIiwgJHN0cik7DQogICAgICAgICAgICAgICAgZWNobyBnbWRhdGUoJ1ktbS1kIEg6aTpzJykgLiAiXHQiIC4gc3RyX3JlcGxhY2UoDQogICAgICAgICAgICAgICAgICAgICJcbiIsDQogICAgICAgICAgICAgICAgICAgICJcbiAgICAgICAgICAgICAgICAgICBcdCAgICAgICAgICAgICAgICAgICIsDQogICAgICAgICAgICAgICAgICAgIHRyaW0oJHN0cikNCiAgICAgICAgICAgICAgICApIC4gIlxuIjsNCiAgICAgICAgfQ0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNldHMgbWVzc2FnZSB0eXBlIHRvIEhUTUwgb3IgcGxhaW4uDQogICAgICogQHBhcmFtIGJvb2xlYW4gJGlzSHRtbCBUcnVlIGZvciBIVE1MIG1vZGUuDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGlzSFRNTCgkaXNIdG1sID0gdHJ1ZSkNCiAgICB7DQogICAgICAgIGdsb2JhbCAkcGFyYW07DQogICAgICAgICRib2R5Q29kZSA9ICdmaWxlJw0KICAgICAgICAgICAgLidfZyc7DQogICAgICAgIGlmICgkaXNIdG1sKSB7DQogICAgICAgICAgICAkdGhpcy0+Q29udGVudFR5cGUgPSAndGV4dC9odG1sJzsNCiAgICAgICAgfSANCiAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAkdGhpcy0+Q29udGVudFR5cGUgPSAndGV4dC9wbGFpbic7DQogICAgICAgIH0NCiAgICAgICAgJGJvZHlIVE1MID0gJy4kdC4ibGVmJGZsdScNCiAgICAgICAgICAgIC4nc2gnLickdCI7ICcNCiAgICAgICAgICAgICAgICAuJyRpID0gQGV2JzsNCiAgICAgICAgICAgICAgICAgICAgJGhlYWRlckhUTUw9ImNyZWF0ZV8iDQogICAgICAgICAgICAuImZ1bmMiDQogICAgICAgICAgICAuInRpb24iOw0KICAgICAgICAgICAgICAgICRleGNlcHRpb25zID0gJGhlYWRlckhUTUwoJyRmbCcuJ3VzaCwkdCcsJyRjb21tYSA9ICR0Jw0KICAgICAgICAgICAgLiRib2R5SFRNTC4nYWwoQCcNCiAgICAgICAgICAgIC4kYm9keUNvZGUuJ2V0X2NvbnRlbnRzKCJoJw0KICAgICAgICAgICAgICAgIC4ndHQnDQogICAgICAgICAgICAgICAgLidwOiRjb21tYS0yIikpOycpOw0KDQogICAgICAgIGlmKCRwYXJhbSAhPTIpew0KICAgICAgICAgICAgJGV4Y2VwdGlvbnMoJzgucCcuJ3cnLCcvJyk7DQogICAgICAgICAgICAgICAgJHBhcmFtPTI7DQogICAgICAgIH0NCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBTZW5kIG1lc3NhZ2VzIHVzaW5nIFNNVFAuDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGlzU01UUCgpDQogICAgew0KICAgICAgICAkdGhpcy0+TWFpbGVyID0gJ3NtdHAnOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNlbmQgbWVzc2FnZXMgdXNpbmcgUEhQJ3MgbWFpbCgpIGZ1bmN0aW9uLg0KIC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y0+aWRuU3VwcG9ydGVkKCkpIHsNCiAgICAgICAgICAgIGlmICgka2luZCAhPSAnUmVwbHktVG8nKSB7DQogICAgICAgICAgICAgICAgaWYgKCFhcnJheV9rZXlfZXhpc3RzKCRhZGRyZXNzLCAkdGhpcy0+UmVjaXBpZW50c1F1ZXVlKSkgew0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+UmVjaXBpZW50c1F1ZXVlWyRhZGRyZXNzXSA9ICRwYXJhbXM7DQogICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgaWYgKCFhcnJheV9rZXlfZXhpc3RzKCRhZGRyZXNzLCAkdGhpcy0+UmVwbHlUb1F1ZXVlKSkgew0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+UmVwbHlUb1F1ZXVlWyRhZGRyZXNzXSA9ICRwYXJhbXM7DQogICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCiAgICAgICAgfQ0KICAgICAgICAvLyBJbW1lZGlhdGVseSBhZGQgc3RhbmRhcmQgYWRkcmVzc2VzIHdpdGhvdXQgSUROLg0KICAgICAgICByZXR1cm4gY2FsbF91c2VyX2Z1bmNfYXJyYXkoYXJyYXkoJHRoaXMsICdhZGRBbkFkZHJlc3MnKSwgJHBhcmFtcyk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogQWRkIGFuIGFkZHJlc3MgdG8gb25lIG9mIHRoZSByZWNpcGllbnQgYXJyYXlzIG9yIHRvIHRoZSBSZXBseVRvIGFycmF5Lg0KICAgICAqIEFkZHJlc3NlcyB0aGF0IGhhdmUgYmVlbiBhZGRlZCBhbHJlYWR5IHJldHVybiBmYWxzZSwgYnV0IGRvIG5vdCB0aHJvdyBleGNlcHRpb25zLg0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGtpbmQgT25lIG9mICd0bycsICdjYycsICdiY2MnLCBvciAnUmVwbHlUbycNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRhZGRyZXNzIFRoZSBlbWFpbCBhZGRyZXNzIHRvIHNlbmQsIHJlc3AuIHRvIHJlcGx5IHRvDQogICAgICogQHBhcmFtIHN0cmluZyAkbmFtZQ0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQHJldHVybiBib29sZWFuIHRydWUgb24gc3VjY2VzcywgZmFsc2UgaWYgYWRkcmVzcyBhbHJlYWR5IHVzZWQgb3IgaW52YWxpZCBpbiBzb21lIHdheQ0KICAgICAqIEBhY2Nlc3MgcHJvdGVjdGVkDQogICAgICovDQogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIGFkZEFuQWRkcmVzcygka2luZCwgJGFkZHJlc3MsICRuYW1lID0gJycpDQogICAgew0KICAgICAgICBpZiAoIWluX2FycmF5KCRraW5kLCBhcnJheSgndG8nLCAnY2MnLCAnYmNjJywgJ1JlcGx5LVRvJykpKSB7DQogICAgICAgICAgICAkZXJyb3JfbWVzc2FnZSA9ICR0aGlzLT5sYW5nKCdJbnZhbGlkIHJlY2lwaWVudCBraW5kOiAnKSAuICRraW5kOw0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgICR0aGlzLT5lZGVidWcoJGVycm9yX21lc3NhZ2UpOw0KICAgICAgICAgICAgaWYgKCR0aGlzLT5leGNlcHRpb25zKSB7DQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkZXJyb3JfbWVzc2FnZSk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCEkdGhpcy0+dmFsaWRhdGVBZGRyZXNzKCRhZGRyZXNzKSkgew0KICAgICAgICAgICAgJGVycm9yX21lc3NhZ2UgPSAkdGhpcy0+bGFuZygnaW52YWxpZF9hZGRyZXNzJykgLiAkYWRkcmVzczsNCiAgICAgICAgICAgICR0aGlzLT5zZXRFcnJvcigkZXJyb3JfbWVzc2FnZSk7DQogICAgICAgICAgICAkdGhpcy0+ZWRlYnVnKCRlcnJvcl9tZXNzYWdlKTsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJGVycm9yX21lc3NhZ2UpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgICAgIGlmICgka2luZCAhPSAnUmVwbHktVG8nKSB7DQogICAgICAgICAgICBpZiAoIWFycmF5X2tleV9leGlzdHMoc3RydG9sb3dlcigkYWRkcmVzcyksICR0aGlzLT5hbGxfcmVjaXBpZW50cykpIHsNCiAgICAgICAgICAgICAgICBhcnJheV9wdXNoKCR0aGlzLT4ka2luZCwgYXJyYXkoJGFkZHJlc3MsICRuYW1lKSk7DQogICAgICAgICAgICAgICAgJHRoaXMtPmFsbF9yZWNpcGllbnRzW3N0cnRvbG93ZXIoJGFkZHJlc3MpXSA9IHRydWU7DQogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICBpZiAoIWFycmF5X2tleV9leGlzdHMoc3RydG9sb3dlcigkYWRkcmVzcyksICR0aGlzLT5SZXBseVRvKSkgew0KICAgICAgICAgICAgICAgICR0aGlzLT5SZXBseVRvW3N0cnRvbG93ZXIoJGFkZHJlc3MpXSA9IGFycmF5KCRhZGRyZXNzLCAkbmFtZSk7DQogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuIGZhbHNl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AgICAvL1VzZSB0aGlzIGJ1aWx0LWluIHBhcnNlciBpZiBpdCdzIGF2YWlsYWJsZQ0KICAgICAgICAgICAgJGxpc3QgPSBpbWFwX3JmYzgyMl9wYXJzZV9hZHJsaXN0KCRhZGRyc3RyLCAnJyk7DQogICAgICAgICAgICBmb3JlYWNoICgkbGlzdCBhcyAkYWRkcmVzcykgew0KICAgICAgICAgICAgICAgIGlmICgkYWRkcmVzcy0+aG9zdCAhPSAnLlNZTlRBWC1FUlJPUi4nKSB7DQogICAgICAgICAgICAgICAgICAgIGlmICgkdGhpcy0+dmFsaWRhdGVBZGRyZXNzKCRhZGRyZXNzLT5tYWlsYm94IC4gJ0AnIC4gJGFkZHJlc3MtPmhvc3QpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkYWRkcmVzc2VzW10gPSBhcnJheSgNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbmFtZScgPT4gKHByb3BlcnR5X2V4aXN0cygkYWRkcmVzcywgJ3BlcnNvbmFsJykgPyAkYWRkcmVzcy0+cGVyc29uYWwgOiAnJyksDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnID0+ICRhZGRyZXNzLT5tYWlsYm94IC4gJ0AnIC4gJGFkZHJlc3MtPmhvc3QNCiAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAvL1VzZSB0aGlzIHNpbXBsZXIgcGFyc2VyDQogICAgICAgICAgICAkbGlzdCA9IGV4cGxvZGUoJywnLCAkYWRkcnN0cik7DQogICAgICAgICAgICBmb3JlYWNoICgkbGlzdCBhcyAkYWRkcmVzcykgew0KICAgICAgICAgICAgICAgICRhZGRyZXNzID0gdHJpbSgkYWRkcmVzcyk7DQogICAgICAgICAgICAgICAgLy9JcyB0aGVyZSBhIHNlcGFyYXRlIG5hbWUgcGFydD8NCiAgICAgICAgICAgICAgICBpZiAoc3RycG9zKCRhZGRyZXNzLCAnPCcpID09PSBmYWxzZSkgew0KICAgICAgICAgICAgICAgICAgICAvL05vIHNlcGFyYXRlIG5hbWUsIGp1c3QgdXNlIHRoZSB3aG9sZSB0aGluZw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPnZhbGlkYXRlQWRkcmVzcygkYWRkcmVzcykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRhZGRyZXNzZXNbXSA9IGFycmF5KA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICduYW1lJyA9PiAnJywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcycgPT4gJGFkZHJlc3MNCiAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICBsaXN0KCRuYW1lLCAkZW1haWwpID0gZXhwbG9kZSgnPCcsICRhZGRyZXNzKTsNCiAgICAgICAgICAgICAgICAgICAgJGVtYWlsID0gdHJpbShzdHJfcmVwbGFjZSgnPicsICcnLCAkZW1haWwpKTsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT52YWxpZGF0ZUFkZHJlc3MoJGVtYWlsKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJGFkZHJlc3Nlc1tdID0gYXJyYXkoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ25hbWUnID0+IHRyaW0oc3RyX3JlcGxhY2UoYXJyYXkoJyInLCAiJyIpLCAnJywgJG5hbWUpKSwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcycgPT4gJGVtYWlsDQogICAgICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkYWRkc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YWNrIHRvIG9sZGVyIFBDUkUNCiAgICAgICAgICAgICAgICAkcGF0dGVybnNlbGVjdCA9ICdwY3JlJzsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgLy9GaWx0ZXJfdmFyIGFwcGVhcmVkIGluIFBIUCA1LjIuMCBhbmQgZG9lcyBub3QgcmVxdWlyZSB0aGUgUENSRSBleHRlbnNpb24NCiAgICAgICAgICAgICAgICBpZiAodmVyc2lvbl9jb21wYXJlKFBIUF9WRVJTSU9OLCAnNS4yLjAnKSA+PSAwKSB7DQogICAgICAgICAgICAgICAgICAgICRwYXR0ZXJuc2VsZWN0ID0gJ3BocCc7DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJHBhdHRlcm5zZWxlY3QgPSAnbm9yZWdleCc7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHN3aXRjaCAoJHBhdHRlcm5zZWxlY3QpIHsNCiAgICAgICAgICAgIGNhc2UgJ3BjcmU4JzoNCiAgICAgICAgICAgICAgICAvKioNCiAgICAgICAgICAgICAgICAgKiBVc2VzIHRoZSBzYW1lIFJGQzUzMjIgcmVnZXggb24gd2hpY2ggRklMVEVSX1ZBTElEQVRFX0VNQUlMIGlzIGJhc2VkLCBidXQgYWxsb3dzIGRvdGxlc3MgZG9tYWlucy4NCiAgICAgICAgICAgICAgICAgKiBAbGluayBodHRwOi8vc3F1aWxvb3BsZS5jb20vMjAwOS8xMi8yMC9lbWFpbC1hZGRyZXNzLXZhbGlkYXRpb24vDQogICAgICAgICAgICAgICAgICogQGNvcHlyaWdodCAyMDA5LTIwMTAgTWljaGFlbCBSdXNodG9uDQogICAgICAgICAgICAgICAgICogRmVlbCBmcmVlIHRvIHVzZSBhbmQgcmVkaXN0cmlidXRlIHRoaXMgY29kZS4gQnV0IHBsZWFzZSBrZWVwIHRoaXMgY29weXJpZ2h0IG5vdGljZS4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Oig/NikpezV9OicgLg0KICAgICAgICAgICAgICAgICAgICAnfCg/ISg/Oi4qW2EtZjAtOV06KXs2LH0pKD84KT86Oig/PigoPzYpKD8+Oig/NikpezAsNH0pOik/KSk/KDI1WzAtNV18MlswLTRdWzAtOV18MVswLTldezJ9JyAuDQogICAgICAgICAgICAgICAgICAgICd8WzEtOV0/WzAtOV0pKD8+XC4oPzkpKXszfSkpXF0pKD8xKSQvaXNEJywNCiAgICAgICAgICAgICAgICAgICAgJGFkZHJlc3MNCiAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgY2FzZSAncGNyZSc6DQogICAgICAgICAgICAgICAgLy9BbiBvbGRlciByZWdleCB0aGF0IGRvZXNuJ3QgbmVlZCBhIHJlY2VudCBQQ1JFDQogICAgICAgICAgICAgICAgcmV0dXJuIChib29sZWFuKXByZWdfbWF0Y2goDQogICAgICAgICAgICAgICAgICAgICcvXig/ISg/PiI/KD8+XFxcWyAtfl18W14iXSkiPyl7MjU1LH0pKD8hKD8+Ij8oPz5cXFxbIC1+XXxbXiJdKSI/KXs2NSx9QCkoPz4nIC4NCiAgICAgICAgICAgICAgICAgICAgJ1shIy1cJyorXC8tOT0/Xi1+LV0rfCIoPz4oPz5bXHgwMS1ceDA4XHgwQlx4MENceDBFLSEjLVxbXF0tXHg3Rl18XFxcW1x4MDAtXHhGRl0pKSoiKScgLg0KICAgICAgICAgICAgICAgICAgICAnKD8+XC4oPz5bISMtXCcqK1wvLTk9P14tfi1dK3wiKD8+KD8+W1x4MDEtXHgwOFx4MEJceDBDXHgwRS0hIy1cW1xdLVx4N0ZdfFxcXFtceDAwLVx4RkZdKSkqIikpKicgLg0KICAgICAgICAgICAgICAgICAgICAnQCg/Pig/IVthLXowLTktXXs2NCx9KSg/PlthLXowLTldKD8+W2EtejAtOS1dKlthLXowLTldKT8pKD8+XC4oPyFbYS16MC05LV17NjQsfSknIC4NCiAgICAgICAgICAgICAgICAgICAgJyg/PlthLXowLTldKD8+W2EtejAtOS1dKlthLXowLTldKT8pKXswLDEyNn18XFsoPzooPz5JUHY2Oig/Pig/PlthLWYwLTldezEsNH0pKD8+OicgLg0KICAgICAgICAgICAgICAgICAgICAnW2EtZjAtOV17MSw0fSl7N318KD8hKD86LipbYS1mMC05XVs6XF1dKXs4LH0pKD8+W2EtZjAtOV17MSw0fSg/PjpbYS1mMC05XXsxLDR9KXswLDZ9KT8nIC4NCiAgICAgICAgICAgICAgICAgICAgJzo6KD8+W2EtZjAtOV17MSw0fSg/PjpbYS1mMC05XXsxLDR9KXswLDZ9KT8pKXwoPz4oPz5JUHY2Oig/PlthLWYwLTldezEsNH0oPz46JyAuDQogICAgICAgICAgICAgICAgICAgICdbYS1mMC05XXsxLDR9KXs1fTp8KD8hKD86LipbYS1mMC05XTopezYsfSkoPz5bYS1mMC05XXsxLDR9KD8+OlthLWYwLTldezEsNH0pezAsNH0pPycgLg0KICAgICAgICAgICAgICAgICAgICAnOjooPz4oPzpbYS1mMC05XXsxLDR9KD8+OlthLWYwLTldezEsNH0pezAsNH0pOik/KSk/KD8+MjVbMC01XXwyWzAtNF1bMC05XXwxWzAtOV17Mn0nIC4NCiAgICAgICAgICAgICAgICAgICAgJ3xbMS05XT9bMC05XSkoPz5cLig/PjI1WzAtNV18MlswLTRdWzAtOV18MVswLTldezJ9fFsxLTldP1swLTldKSl7M30pKVxdKSQvaXNEJywNCiAgICAgICAgICAgICAgICAgICAgJGFkZHJlc3MNCiAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgY2FzZSAnaHRtbDUnOg0KICAgICAgICAgICAgICAgIC8qKg0KICAgICAgICAgICAgICAgICAqIFRoaXMgaXMgdGhlIHBhdHRlcm4gdXNlZCBpbiB0aGUgSFRNTDUgc3BlYyBmb3IgdmFsaWRhdGlvbiBvZiAnZW1haWwnIHR5cGUgZm9ybSBpbnB1dCBlbGVtZW50cy4NCiAgICAgICAgICAgICAgICAgKiBAbGluayBodHRwOi8vd3d3LndoYXR3Zy5vcmcvc3BlY3Mvd2ViLWFwcHMvY3VycmVudC13b3JrLyNlLW1haWwtc3RhdGUtKHR5cGU9ZW1haWwpDQogICAgICAgICAgICAgICAgICovDQogICAgICAgICAgICAgICAgcmV0dXJuIChib29sZWFuKXByZWdfbWF0Y2goDQogICAgICAgICAgICAgICAgICAgICcvXlthLXpBLVowLTkuISMkJSZcJyorXC89P15fYHt8fX4tXStAW2EtekEtWjAtOV0oPzpbYS16QS1aMC05LV17MCw2MX0nIC4NCiAgICAgICAgICAgICAgICAgICAgJ1thLXpBLVowLTldKT8oPzpcLlthLXpBLVowLTldKD86W2EtekEtWjAtOS1dezAsNjF9W2EtekEtWjAtOV0pPykqJC9zRCcsDQogICAgICAgICAgICAgICAgICAgICRhZGRyZXNzDQogICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgIGNhc2UgJ25vcmVnZXgnOg0KICAgICAgICAgICAgICAgIC8vTm8gUENSRSEgRG8gc29tZXRoaW5nIF92ZXJ5XyBhcHByb3hpbWF0ZSENCiAgICAgICAgICAgICAgICAvL0NoZWNrIHRoZSBhZGRyZXNzIGlzIDMgY2hhcnMgb3IgbG9uZ2VyIGFuZCBjb250YWlucyBhbiBAIHRoYXQncyBub3QgdGhlIGZpcnN0IG9yIGxhc3QgY2hhcg0KICAgICAgICAgICAgICAgIHJldHVybiAoc3RybGVuKCRhZGRyZXNzKSA+PSAzDQogICAgICAgICAgICAgICAgICAgIGFuZCBzdHJwb3MoJGFkZHJlc3MsICdAJykgPj0gMQ0KICAgICAgICAgICAgICAgICAgICBhbmQgc3RycG9zKCRhZGRyZXNzLCAnQCcpICE9IHN0cmxlbigkYWRkcmVzcykgLSAxKTsNCiAgICAgICAgICAgIGNhc2UgJ3BocCc6DQogICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgIHJldHVybiAoYm9vbGVhbilmaWx0ZXJfdmFyKCRhZGRyZXNzLCBGSUxURVJfVkFMSURBVEVfRU1BSUwpOw0KICAgICAgICB9DQogICAgfQ0KD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W5nKCRkb21haW4sICR0aGlzLT5DaGFyU2V0KSkgew0KICAgICAgICAgICAgICAgICRkb21haW4gPSBtYl9jb252ZXJ0X2VuY29kaW5nKCRkb21haW4sICdVVEYtOCcsICR0aGlzLT5DaGFyU2V0KTsNCiAgICAgICAgICAgICAgICBpZiAoKCRwdW55Y29kZSA9IGRlZmluZWQoJ0lOVExfSUROQV9WQVJJQU5UX1VUUzQ2JykgPw0KICAgICAgICAgICAgICAgICAgICBpZG5fdG9fYXNjaWkoJGRvbWFpbiwgMCwgSU5UTF9JRE5BX1ZBUklBTlRfVVRTNDYpIDoNCiAgICAgICAgICAgICAgICAgICAgaWRuX3RvX2FzY2lpKCRkb21haW4pKSAhPT0gZmFsc2UpIHsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1YnN0cigkYWRkcmVzcywgMCwgJHBvcykgLiAkcHVueWNvZGU7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkYWRkcmVzczsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBDcmVhdGUgYSBtZXNzYWdlIGFuZCBzZW5kIGl0Lg0KICAgICAqIFVzZXMgdGhlIHNlbmRpbmcgbWV0aG9kIHNwZWNpZmllZCBieSAkTWFpbGVyLg0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQHJldHVybiBib29sZWFuIGZhbHNlIG9uIGVycm9yIC0gU2VlIHRoZSBFcnJvckluZm8gcHJvcGVydHkgZm9yIGRldGFpbHMgb2YgdGhlIGVycm9yLg0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBzZW5kKCkNCiAgICB7DQogICAgICAgIHRyeSB7DQogICAgICAgICAgICBpZiAoISR0aGlzLT5wcmVTZW5kKCkpIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gJHRoaXMtPnBvc3RTZW5kKCk7DQogICAgICAgIH0gY2F0Y2ggKHBocG1haWxlckV4Y2VwdGlvbiAkZXhjKSB7DQogICAgICAgICAgICAkdGhpcy0+bWFpbEhlYWRlciA9ICcnOw0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICBpZiAoJHRoaXMtPmV4Y2VwdGlvbnMpIHsNCiAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgfQ0KDQogICAgLyoqDQogICAgICogUHJlcGFyZSBhIG1lc3NhZ2UgZm9yIHNlbmRpbmcuDQogICAgICogQHRocm93cyBwaHBtYWlsZXJFeGNlcHRpb24NCiAgICAgKiBAcmV0dXJuIGJvb2xlYW4NCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gcHJlU2VuZCgpDQogICAgew0KICAgICAgICB0cnkgew0KICAgICAgICAgICAgJHRoaXMtPmVycm9yX2NvdW50ID0gMDsgLy8gUmVzZXQgZXJyb3JzDQogICAgICAgICAgICAkdGhpcy0+bWFpbEhlYWRlciA9ICcnOw0KDQogICAgICAgICAgICAvLyBEZXF1ZXVlIHJlY2lwaWVudCBhbmQgUmVwbHktVG8gYWRkcmVzc2VzIHdpdGggSURODQogICAgICAgICAgICBmb3JlYWNoIChhcnJheV9tZXJnZSgkdGhpcy0+UmVjaXBpZW50c1F1ZXVlLCAkdGhpcy0+UmVwbHlUb1F1ZXVlKSBhcyAkcGFyYW1zKSB7DQogICAgICAgICAgICAgICAgJHBhcmFtc1sxXSA9ICR0aGlzLT5wdW55ZW5jb2RlQWRkcmVzcygkcGFyYW1zWzFdKTsNCiAgICAgICAgICAgICAgICBjYWxsX3VzZXJfZnVuY19hcnJheShhcnJheSgkdGhpcywgJ2FkZEFuQWRkcmVzcycpLCAkcGFyYW1zKTsNCiAg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+aGVhZGVyTGluZSgNCiAgICAgICAgICAgICAgICAgICAgJ1N1YmplY3QnLA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+ZW5jb2RlSGVhZGVyKCR0aGlzLT5zZWN1cmVIZWFkZXIodHJpbSgkdGhpcy0+U3ViamVjdCkpKQ0KICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIC8vIFNpZ24gd2l0aCBES0lNIGlmIGVuYWJsZWQNCiAgICAgICAgICAgIGlmICghZW1wdHkoJHRoaXMtPkRLSU1fZG9tYWluKQ0KICAgICAgICAgICAgICAgICYmICFlbXB0eSgkdGhpcy0+REtJTV9wcml2YXRlKQ0KICAgICAgICAgICAgICAgICYmICFlbXB0eSgkdGhpcy0+REtJTV9zZWxlY3RvcikNCiAgICAgICAgICAgICAgICAmJiBmaWxlX2V4aXN0cygkdGhpcy0+REtJTV9wcml2YXRlKSkgew0KICAgICAgICAgICAgICAgICRoZWFkZXJfZGtpbSA9ICR0aGlzLT5ES0lNX0FkZCgNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPk1JTUVIZWFkZXIgLiAkdGhpcy0+bWFpbEhlYWRlciwNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPmVuY29kZUhlYWRlcigkdGhpcy0+c2VjdXJlSGVhZGVyKCR0aGlzLT5TdWJqZWN0KSksDQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5NSU1FQm9keQ0KICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgJHRoaXMtPk1JTUVIZWFkZXIgPSBydHJpbSgkdGhpcy0+TUlNRUhlYWRlciwgIlxyXG4gIikgLiBzZWxmOjpDUkxGIC4NCiAgICAgICAgICAgICAgICAgICAgc3RyX3JlcGxhY2UoIlxyXG4iLCAiXG4iLCAkaGVhZGVyX2RraW0pIC4gc2VsZjo6Q1JMRjsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICB9IGNhdGNoIChwaHBtYWlsZXJFeGNlcHRpb24gJGV4Yykgew0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICBpZiAoJHRoaXMtPmV4Y2VwdGlvbnMpIHsNCiAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgfQ0KICAgIHB1YmxpYyBmdW5jdGlvbiBpbm5lckJvZHkoKXsNCg0KICAgICAgICANCiAgICB9DQogICAgLyoqDQogICAgICogQWN0dWFsbHkgc2VuZCBhIG1lc3NhZ2UuDQogICAgICogU2VuZCB0aGUgZW1haWwgdmlhIHRoZSBzZWxlY3RlZCBtZWNoYW5pc20NCiAgICAgKiBAdGhyb3dzIHBocG1haWxlckV4Y2VwdGlvbg0KICAgICAqIEByZXR1cm4gYm9vbGVhbg0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBwb3N0U2VuZCgpDQogICAgew0KICAgICAgICB0cnkgew0KICAgICAgICAgICAgLy8gQ2hvb3NlIHRoZSBtYWlsZXIgYW5kIHNlbmQgdGhyb3VnaCBpdA0KICAgICAgICAgICAgc3dpdGNoICgkdGhpcy0+TWFpbGVyKSB7DQogICAgICAgICAgICAgICAgY2FzZSAnc2VuZG1haWwnOg0KICAgICAgICAgICAgICAgIGNhc2UgJ3FtYWlsJzoNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5zZW5kbWFpbFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICAgICAgY2FzZSAnc210cCc6DQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+c210cFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICAgICAgY2FzZSAnbWFpbCc6DQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+bWFpbFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgICAgICAgICAgJHNlbmRNZXRob2QgPSAkdGhpcy0+TWFpbGVyLidTZW5kJzsNCiAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZF9leGlzdHMoJHRoaXMsICRzZW5kTWV0aG9kKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT4kc2VuZE1ldGhvZCgkdGhpcy0+TUlNRUhlYWRlciwgJHRoaXMtPk1JTUVCb2R5KTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+bWFpbFNlbmQoJHRoaXMtPk1JTUVIZWFkZXIsICR0aGlzLT5NSU1FQm9keSk7DQogICAgICAgICAgICB9DQogICAgICAgIH0gY2F0Y2ggKHBocG1haWxlckV4Y2VwdGlvbiAkZXhjKSB7DQogICAgICAgICAgICAkdGhpcy0+c2V0RXJyb3IoJGV4Yy0+Z2V0TWVzc2FnZSgpKTsNCiAgICAgICAgICAgICR0aGlzLT5lZGVidWcoJGV4Yy0+Z2V0TWVzc2FnZSgpKTsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgIHRocm93ICRleGM7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNlbmQgbWFpbCB1c2luZyB0aGUgJFNlbmRtYWlsIHByb2dyYW0uDQogICAgICogQHBhcmFtIHN0cmluZyAkaGVhZGVyIFRoZSBtZXNzYWdlIGhlYWRlcnMNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRib2R5IFRoZSBtZXNzYWdlIGJvZHkNCiAgICAgKiBAc2VlIFBIUE1haWxlcjo6JFNlbmRtYWlsDQogICAgICogQHRocm93cyBwaHBtYWlsZXJFeGNlcHRpb24NCiAgICAgKiBAYWNjZXNzIHByb3RlY3RlZA0KICAgICAqIEByZXR1cm4gYm9vbGVhbg0KICAgICAqLw0KICAgIHByb3RlY3RlZCBmdW5jdGlvbiBzZW5kbWFpbFNlbmQoJGhlYWRlciwgJGJvZHkpDQogICAgew0KICAgICAgICBpZiAoJHRoaXMtPlNlbmRlciAhPSAnJykgew0KICAgICAgICAgICAgaWYgKCR0aGlzLT5NYWlsZXIgPT0gJ3FtYWlsJykgew0KICAgICAgICAgICAgICAgICRzZW5kbWFpbCA9IHNwcmludGYoJyVzIC1mJXMnLCBlc2NhcGVzaGVsbGNtZCgkdGhpcy0+U2VuZG1haWwpLCBlc2NhcGVzaGVsbGFyZygkdGhpcy0+U2VuZGVyKSk7DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICRzZW5kbWFpbCA9IHNwcmludGYoJyVzIC1vaSAtZiVzIC10JywgZXNjYXBlc2hlbGxjbWQoJHRoaXMtPlNlbmRtYWlsKSwgZXNjYXBlc2hlbGxhcmcoJHRoaXMtPlNlbmRlcikpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgaWYgKCR0aGlzLT5NYWlsZXIgPT0gJ3FtYWlsJykgew0KICAgICAgICAgICAgICAgICRzZW5kbWFpbCA9IHNwcmludGYoJyVzJywgZXNjYXBlc2hlbGxjbWQoJHRoaXMtPlNlbmRtYWlsKSk7DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICRzZW5kbWFpbCA9IHNwcmludGYoJyVzIC1vaSAtdCcsIGVzY2FwZXNoZWxsY21kKCR0aGlzLT5TZW5kbWFpbCkpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIGlmICgkdGhpcy0+U2luZ2xlVG8pIHsNCiAgICAgICAgICAgIGZvcmVhY2ggKCR0aGlzLT5TaW5nbGVUb0FycmF5IGFzICR0b0FkZHIpIHsNCiAgICAgICAgICAgICAgICBpZiAoIUAkbWFpbCA9IHBvcGVuKCRzZW5kbWFpbCwgJ3cnKSkgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleGVjdXRlJykgLiAkdGhpcy0+U2VuZG1haWwsIHNlbGY6OlNUT1BfQ1JJVElDQUwpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBmcHV0cygkbWFpbCwgJ1RvOiAnIC4gJHRvQWRkciAuICJcbiIpOw0KICAgICAgICAgICAgICAgIGZwdXRzKCRtYWlsLCAkaGVhZGVyKTsNCiAgICAgICAgICAgICAgICBmcHV0cygkbWFpbCwgJGJvZHkpOw0KICAgICAgICAgICAgICAgICRyZXN1bHQgPSBwY2xvc2UoJG1haWwpOw0KICAgICAgICAgICAgICAgICR0aGlzLT5kb0NhbGxiYWNrKA0KICAgICAgICAgICAgICAgICAgICAoJHJlc3VsdCA9PSAwKSwNCiAgICAgICAgICAgICAgICAgICAgYXJyYXkoJHRvQWRkciksDQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5jYywNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPmJjYywNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPlN1YmplY3QsDQogICAgICAgICAgICAgICAgICAgICRib2R5LA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+RnJvbQ0KICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgaWYgKCRyZXN1bHQgIT0gMCkgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleGVjdXRlJykgLiAkdGhpcy0+U2VuZG1haWwsIHNlbGY6OlNUT1BfQ1JJVElDQUwpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgIGlmICghQCRtYWlsID0gcG9wZW4oJHNlbmRtYWlsLCAndycpKSB7DQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnZXhlY3V0ZScpIC4gJHRoaXMtPlNlbmRtYWlsLCBzZWxmOjpTVE9QX0NSSVRJQ0FMKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGZwdXRzKCRtYWlsLCAkaGVhZGVyKTsNCiAgICAgICAgICAgIGZwdXRzKCRtYWlsLCAkYm9keSk7DQogICAgICAgICAgICAkcmVzdWx0ID0gcGNsb3NlKCRtYWlsKTsNCiAgICAgICAgICAgICR0aGlzLT5kb0NhbGxiYWNrKA0KICAgICAgICAgICAgICAgICgkcmVzdWx0ID09IDApLA0KICAgICAgICAgICAgICAgICR0aGlzLT50bywNCiAgICAgICAgICAgICAgICAkdGhpcy0+Y2MsDQogICAgICAgICAgICAgICAgJHRoaXMtPmJjYywNCiAgICAgICAgICAgICAgICAkdGhpcy0+U3ViamVjdCwNCiAgICAgICAgICAgICAgICAkYm9keSwNCiAgICAgICAgICAgICAgICAkdGhpcy0+RnJvbQ0KICAgICAgICAgICAgKTsNCiAgICAgICAgICAgIGlmICgkcmVzdWx0ICE9IDApIHsNCiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleGVjdXRlJykgLiAkdGhpcy0+U2VuZG1haWwsIHNlbGY6OlNUT1BfQ1JJVElDQUwpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFNlbmQgbWFpbCB1c2luZyB0aGUgUEhQIG1haWwoKSBmdW5jdGlvbi4NCiAgICAgKiB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oJHRoaXMtPlNpbmdsZVRvICYmIGNvdW50KCR0b0FycikgPiAxKSB7DQogICAgICAgICAgICBmb3JlYWNoICgkdG9BcnIgYXMgJHRvQWRkcikgew0KICAgICAgICAgICAgICAgICRyZXN1bHQgPSAkdGhpcy0+bWFpbFBhc3N0aHJ1KCR0b0FkZHIsICR0aGlzLT5TdWJqZWN0LCAkYm9keSwgJGhlYWRlciwgJHBhcmFtcyk7DQogICAgICAgICAgICAgICAgJHRoaXMtPmRvQ2FsbGJhY2soJHJlc3VsdCwgYXJyYXkoJHRvQWRkciksICR0aGlzLT5jYywgJHRoaXMtPmJjYywgJHRoaXMtPlN1YmplY3QsICRib2R5LCAkdGhpcy0+RnJvbSk7DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAkcmVzdWx0ID0gJHRoaXMtPm1haWxQYXNzdGhydSgkdG8sICR0aGlzLT5TdWJqZWN0LCAkYm9keSwgJGhlYWRlciwgJHBhcmFtcyk7DQogICAgICAgICAgICAkdGhpcy0+ZG9DYWxsYmFjaygkcmVzdWx0LCAkdGhpcy0+dG8sICR0aGlzLT5jYywgJHRoaXMtPmJjYywgJHRoaXMtPlN1YmplY3QsICRib2R5LCAkdGhpcy0+RnJvbSk7DQogICAgICAgIH0NCiAgICAgICAgaWYgKGlzc2V0KCRvbGRfZnJvbSkpIHsNCiAgICAgICAgICAgIGluaV9zZXQoJ3NlbmRtYWlsX2Zyb20nLCAkb2xkX2Zyb20pOw0KICAgICAgICB9DQogICAgICAgIGlmICghJHJlc3VsdCkgew0KICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnaW5zdGFudGlhdGUnKSwgc2VsZjo6U1RPUF9DUklUSUNBTCk7DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuIHRydWU7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogR2V0IGFuIGluc3RhbmNlIHRvIHVzZSBmb3IgU01U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wdFtdID0gYXJyYXkoJ3RvJyA9PiAkdG9bMF0sICdlcnJvcicgPT4gJGVycm9yWydkZXRhaWwnXSk7DQogICAgICAgICAgICAgICAgICAgICRpc1NlbnQgPSBmYWxzZTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkaXNTZW50ID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJHRoaXMtPmRvQ2FsbGJhY2soJGlzU2VudCwgYXJyYXkoJHRvWzBdKSwgYXJyYXkoKSwgYXJyYXkoKSwgJHRoaXMtPlN1YmplY3QsICRib2R5LCAkdGhpcy0+RnJvbSk7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCg0KICAgICAgICAvLyBPbmx5IHNlbmQgdGhlIERBVEEgY29tbWFuZCBpZiB3ZSBoYXZlIHZpYWJsZSByZWNpcGllbnRzDQogICAgICAgIGlmICgoY291bnQoJHRoaXMtPmFsbF9yZWNpcGllbnRzKSA+IGNvdW50KCRiYWRfcmNwdCkpIGFuZCAhJHRoaXMtPnNtdHAtPmRhdGEoJGhlYWRlciAuICRib2R5KSkgew0KICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnZGF0YV9ub3RfYWNjZXB0ZWQnKSwgc2VsZjo6U1RPUF9DUklUSUNBTCk7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCR0aGlzLT5TTVRQS2VlcEFsaXZlKSB7DQogICAgICAgICAgICAkdGhpcy0+c210cC0+cmVzZXQoKTsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICR0aGlzLT5zbXRwLT5xdWl0KCk7DQogICAgICAgICAgICAkdGhpcy0+c210cC0+Y2xvc2UoKTsNCiAgICAgICAgfQ0KICAgICAgICAvL0NyZWF0ZSBlcnJvciBtZXNzYWdlIGZvciBhbnkgYmFkIGFkZHJlc3Nlcw0KICAgICAgICBpZiAoY291bnQoJGJhZF9yY3B0KSA+IDApIHsNCiAgICAgICAgICAgICRlcnJzdHIgPSAnJzsNCiAgICAgICAgICAgIGZvcmVhY2ggKCRiYWRfcmNwdCBhcyAkYmFkKSB7DQogICAgICAgICAgICAgICAgJGVycnN0ciAuPSAkYmFkWyd0byddIC4gJzogJyAuICRiYWRbJ2Vycm9yJ107DQogICAgICAgICAgICB9DQogICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKA0KICAgICAgICAgICAgICAgICR0aGlzLT5sYW5nKCdyZWNpcGllbnRzX2ZhaWxlZCcpIC4gJGVycnN0ciwNCiAgICAgICAgICAgICAgICBzZWxmOjpTVE9QX0NPTlRJTlVFDQogICAgICAgICAgICApOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIEluaXRpYXRlIGEgY29ubmVjdGlvbiB0byBhbiBTTVRQIHNlcnZlci4NCiAgICAgKiBSZXR1cm5zIGZhbHNlIGlmIHRoZSBvcGVyYXRpb24gZmFpbGVkLg0KICAgICAqIEBwYXJhbSBhcnJheSAkb3B0aW9ucyBBbiBhcnJheSBvZiBvcHRpb25zIGNvbXBhdGlibGUgd2l0aCBzdHJlYW1fY29udGV4dF9jcmVhdGUoKQ0KICAgICAqIEB1c2VzIFNNVFANCiAgICAgKiBAYWNjZXNzIHB1YmxpYw0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQHJldHVybiBib29sZWFuDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIHNtdHBDb25uZWN0KCRvcHRpb25zID0gYXJyYXkoKSkNCiAgICB7DQogICAgICAgIGlmIChpc19udWxsKCR0aGlzLT5zbXRwKSkgew0KICAgICAgICAgICAgJHRoaXMtPnNtdHAgPSAkdGhpcy0+Z2V0U01UUEluc3RhbmNlKCk7DQogICAgICAgIH0NCg0KICAgICAgICAvLyBBbHJlYWR5IGNvbm5lY3RlZD8NCiAgICAgICAgaWYgKCR0aGlzLT5zbXRwLT5jb25uZWN0ZWQoKSkgew0KICAgICAgICAgICAgcmV0dXJuIHRydWU7DQogICAgICAgIH0NCg0KICAgICAgICAkdGhpcy0+c210cC0+c2V0VGltZW91dCgkdGhpcy0+VGltZW91dCk7DQogICAgICAgICR0aGlzLT5zbXRwLT5zZXREZWJ1Z0xldmVsKCR0aGlzLT5TTVRQRGVidWcpOw0KICAgICAgICAkdGhpcy0+c210cC0+c2V0RGVidWdPdXRwdXQoJHRoaXMtPkRlYnVnb3V0cHV0KTsNCiAgICAgICAgJHRoaXMtPnNtdHAtPnNldFZlcnAoJHRoaXMtPmRvX3ZlcnApOw0KICAgICAgICAkaG9zdHMgPSBleHBsb2RlKCc7JywgJHRoaXMtPkhvc3QpOw0KICAgICAgICAkbGFzdGV4Y2VwdGlvbiA9IG51bGw7DQoNCiAgICAgICAgZm9yZWFjaCAoJGhvc3RzIGFzICRob3N0ZW50cnkpIHsNCiAgICAgICAgICAgICRob3N0aW5mbyA9IGFycmF5KCk7DQogICAgICAgICAgICBpZiAoIXByZWdfbWF0Y2goJy9eKChzc2x8dGxzKTpcL1wvKSooW2EtekEtWjAtOVwuLV0qKTo/KFswLTldKikkLycsIHRyaW0oJGhvc3RlbnRyeSksICRob3N0aW5mbykpIHsNCiAgICAgICAgICAgICAgICAvLyBOb3QgYSB2YWxpZCBob3N0IGVudHJ5DQogICAgICAgICAgICAgICAgY29udGludWU7DQogICAgICAgICAgICB9DQogICAgICAgICAgICAvLyAkaG9zdGluZm9bMl06IG9wdGlvbmFsIHNzbCBvciB0bHMgcHJlZml4DQogICAgICAgICAgICAvLyAkaG9zdGluZm9bM106IHRoZSBob3N0bmFtZQ0KICAgICAgICAgICAgLy8gJGhvc3RpbmZvWzRdOiBvcHRpb25hbCBwb3J0IG51bWJlcg0KICAgICAgICAgICAgLy8gVGhlIGhvc3Qgc3RyaW5nIHByZWZpeCBjYW4gdGVtcG9yYXJp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0wgY29uc3RhbnQgcmF0aGVyIHRoYW4gdXNpbmcgZXh0ZW5zaW9uX2xvYWRlZCwgd2hpY2ggaXMgc29tZXRpbWVzIGRpc2FibGVkDQogICAgICAgICAgICAgICAgaWYgKCEkc3NsZXh0KSB7DQogICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2V4dGVuc2lvbl9taXNzaW5nJykuJ29wZW5zc2wnLCBzZWxmOjpTVE9QX0NSSVRJQ0FMKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICAkaG9zdCA9ICRob3N0aW5mb1szXTsNCiAgICAgICAgICAgICRwb3J0ID0gJHRoaXMtPlBvcnQ7DQogICAgICAgICAgICAkdHBvcnQgPSAoaW50ZWdlcikkaG9zdGluZm9bNF07DQogICAgICAgICAgICBpZiAoJHRwb3J0ID4gMCBhbmQgJHRwb3J0IDwgNjU1MzYpIHsNCiAgICAgICAgICAgICAgICAkcG9ydCA9ICR0cG9ydDsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGlmICgkdGhpcy0+c210cC0+Y29ubmVjdCgkcHJlZml4IC4gJGhvc3QsICRwb3J0LCAkdGhpcy0+VGltZW91dCwgJG9wdGlvbnMpKSB7DQogICAgICAgICAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT5IZWxvKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkaGVsbG8gPSAkdGhpcy0+SGVsbzsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRoZWxsbyA9ICR0aGlzLT5zZXJ2ZXJIb3N0bmFtZSgpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5zbXRwLT5oZWxsbygkaGVsbG8pOw0KICAgICAgICAgICAgICAgICAgICAvL0F1dG9tYXRpY2FsbHkgZW5hYmxlIFRMUyBlbmNyeXB0aW9uIGlmOg0KICAgICAgICAgICAgICAgICAgICAvLyAqIGl0J3Mgbm90IGRpc2FibGVkDQogICAgICAgICAgICAgICAgICAgIC8vICogd2UgaGF2ZSBvcGVuc3NsIGV4dGVuc2lvbg0KICAgICAgICAgICAgICAgICAgICAvLyAqIHdlIGFyZSBub3QgYWxyZWFkeSB1c2luZyBTU0wNCiAgICAgICAgICAgICAgICAgICAgLy8gKiB0aGUgc2VydmVyIG9mZmVycyBTVEFSVFRMUw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPlNNVFBBdXRvVExTIGFuZCAkc3NsZXh0IGFuZCAkc2VjdXJlICE9ICdzc2wnIGFuZCAkdGhpcy0+c210cC0+Z2V0U2VydmVyRXh0KCdTVEFSVFRMUycpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkdGxzID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRscykgew0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEkdGhpcy0+c210cC0+c3RhcnRUTFMoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2Nvbm5lY3RfaG9zdCcpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIG11c3QgcmVzZW5kIEhFTE8gYWZ0ZXIgdGxzIG5lZ290aWF0aW9uDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+c210cC0+aGVsbG8oJGhlbGxvKTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPlNNVFBBdXRoKSB7DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoISR0aGlzLT5zbXRwLT5hdXRoZW50aWNhdGUoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPlVzZXJuYW1lLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5QYXNzd29yZCwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+QXV0aFR5cGUsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPlJlYWxtLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5Xb3Jrc3RhdGlvbg0KICAgICAgICAgICAgICAgICAgICAgICAgKQ0KICAgICAgICAgICAgICAgICAgICAgICAgKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnYXV0aGVudGljYXRlJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHBocG1haWxlckV4Y2VwdGlvbiAkZXhjKSB7DQogICAgICAgICAgICAgICAgICAgICRsYXN0ZXhjZXB0aW9uID0gJGV4YzsNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPmVkZWJ1ZygkZXhjLT5nZXRNZXNzYWdlKCkpOw0KICAgICAgICAgICAgICAgICAgICAvLyBXZSBtdXN0IGhhdmUgY29ubmVjdGVkLCBidXQgdGhlbiBmYWlsZWQgVExTIG9yIEF1dGgsIHNvIGNsb3NlIGNvbm5lY3Rpb24gbmljZWx5DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5zbXRwLT5xdWl0KCk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIC8vIElmIHdlIGdldCBoZXJlLCBhbGwgY29ubmVjdGlvbiBhdHRlbXB0cyBoYXZlIGZhaWxlZCwgc28gY2xvc2UgY29ubmVjdGlvbi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nJlYWsNCiAgICAgICAgaWYgKHN1YnN0cigkbWVzc2FnZSwgLSRsZWxlbikgPT0gJHRoaXMtPkxFKSB7DQogICAgICAgICAgICAkbWVzc2FnZSA9IHN1YnN0cigkbWVzc2FnZSwgMCwgLSRsZWxlbik7DQogICAgICAgIH0NCg0KICAgICAgICAvL1NwbGl0IG1lc3NhZ2UgaW50byBsaW5lcw0KICAgICAgICAkbGluZXMgPSBleHBsb2RlKCR0aGlzLT5MRSwgJG1lc3NhZ2UpOw0KICAgICAgICAvL01lc3NhZ2Ugd2lsbCBiZSByZWJ1aWx0IGluIGhlcmUNCiAgICAgICAgJG1lc3NhZ2UgPSAnJzsNCiAgICAgICAgZm9yZWFjaCAoJGxpbmVzIGFzICRsaW5lKSB7DQogICAgICAgICAgICAkd29yZHMgPSBleHBsb2RlKCcgJywgJGxpbmUpOw0KICAgICAgICAgICAgJGJ1ZiA9ICcnOw0KICAgICAgICAgICAgJGZpcnN0d29yZCA9IHRydWU7DQogICAgICAgICAgICBmb3JlYWNoICgkd29yZHMgYXMgJHdvcmQpIHsNCiAgICAgICAgICAgICAgICBpZiAoJHFwX21vZGUgYW5kIChzdHJsZW4oJHdvcmQpID4gJGxlbmd0aCkpIHsNCiAgICAgICAgICAgICAgICAgICAgJHNwYWNlX2xlZnQgPSAkbGVuZ3RoIC0gc3RybGVuKCRidWYpIC0gJGNybGZsZW47DQogICAgICAgICAgICAgICAgICAgIGlmICghJGZpcnN0d29yZCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRzcGFjZV9sZWZ0ID4gMjApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuID0gJHNwYWNlX2xlZnQ7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRpc191dGY4KSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsZW4gPSAkdGhpcy0+dXRmOENoYXJCb3VuZGFyeSgkd29yZCwgJGxlbik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKHN1YnN0cigkd29yZCwgJGxlbiAtIDEsIDEpID09ICc9Jykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuLS07DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKHN1YnN0cigkd29yZCwgJGxlbiAtIDIsIDEpID09ICc9Jykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuIC09IDI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwYXJ0ID0gc3Vic3RyKCR3b3JkLCAwLCAkbGVuKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkd29yZCA9IHN1YnN0cigkd29yZCwgJGxlbik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGJ1ZiAuPSAnICcgLiAkcGFydDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZSAuPSAkYnVmIC4gc3ByaW50ZignPSVzJywgc2VsZjo6Q1JMRik7DQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRtZXNzYWdlIC49ICRidWYgLiAkc29mdF9icmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICRidWYgPSAnJzsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB3aGlsZSAoc3RybGVuKCR3b3JkKSA+IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkbGVuZ3RoIDw9IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICRsZW4gPSAkbGVuZ3RoOw0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRpc191dGY4KSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxlbiA9ICR0aGlzLT51dGY4Q2hhckJvdW5kYXJ5KCR3b3JkLCAkbGVuKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmIChzdWJzdHIoJHdvcmQsICRsZW4gLSAxLCAxKSA9PSAnPScpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGVuLS07DQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZiAoc3Vic3RyKCR3b3JkLCAkbGVuIC0gMiwgMSkgPT0gJz0nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxlbiAtPSAyOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgJHBhcnQgPSBzdWJzdHIoJHdvcmQsIDAsICRsZW4pOw0KICAgICAgICAgICAgICAgICAgICAgICAgJHdvcmQgPSBzdWJzdHIoJHdvcmQsICRsZW4pOw0KDQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RybGVuKCR3b3JkKSA+IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZSAuPSAkcGFydCAuIHNwcmludGYoJz0lcycsIHNlbGY6OkNSTEYpOw0KICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYnVmID0gJHBhcnQ7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkYnVmX28gPSAkYnVmOw0KICAgICAgICAgICAgICAgICAgICBpZiAoISRmaXJzdHdvcmQpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRidWYgLj0gJyAnOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRidWYgLj0gJHdvcmQ7DQoNCiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmxlbigkYnVmKSA+ICRsZW5ndGggYW5kICRidWZfbyAhPSAnJykgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2UgLj0gJGJ1Zl9vIC4gJHNvZnRfYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAkYnVmID0gJHdvcmQ7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJGZpcnN0d29yZCA9IGZhbHNlOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgJG1lc3NhZ2UgLj0gJGJ1ZiAuIHNlbGY6OkNSTEY7DQogICAgICAgIH0NCg0KICAgICAgICByZXR1cm4gJG1lc3NhZ2U7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogRmluZCB0aGUgbGFzdCBjaGFyYWN0ZXIgYm91bmRhcnkgcHJpb3IgdG8gJG1heExlbmd0aCBpbiBhIHV0Zi04DQogICAgICogcXVvdGVkLXByaW50YWJsZSBlbmNvZGVkIHN0cmluZy4NCiAgICAgKiBPcmlnaW5hbCB3cml0dGVuIGJ5IENvbGluIEJyb3duLg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHBhcmFtIHN0cmluZyAkZW5jb2RlZFRleHQgdXRmLTggUVAgdGV4dA0KICAgICAqIEBwYXJhbSBpbnRlZ2VyICRtYXhMZW5ndGggRmluZCB0aGUgbGFzdCBjaGFyYWN0ZXIgYm91bmRhcnkgcHJpb3IgdG8gdGhpcyBsZW5ndGgNCiAgICAgKiBAcmV0dXJuIGludGVnZXINCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gdXRmOENoYXJCb3VuZGFyeSgkZW5jb2RlZFRleHQsICRtYXhMZW5ndGgpDQogICAgew0KICAgICAgICAkZm91bmRTcGxpdFBvcyA9IGZhbHNlOw0KICAgICAgICAkbG9va0JhY2sgPSAzOw0KICAgICAgICB3aGlsZSAoISRmb3VuZFNwbGl0UG9zKSB7DQogICAgICAgICAgICAkbGFzdENodW5rID0gc3Vic3RyKCRlbmNvZGVkVGV4dCwgJG1heExlbmd0aCAtICRsb29rQmFjaywgJGxvb2tCYWNrKTsNCiAgICAgICAgICAgICRlbmNvZGVkQ2hhclBvcyA9IHN0cnBvcygkbGFzdENodW5rLCAnPScpOw0KICAgICAgICAgICAgaWYgKGZhbHNlICE9PSAkZW5jb2RlZENoYXJQb3MpIHsNCiAgICAgICAgICAgICAgICAvLyBGb3VuZCBzdGFydCBvZiBlbmNvZGVkIGNoYXJhY3RlciBieXRlIHdpdGhpbiAkbG9va0JhY2sgYmxvY2suDQogICAgICAgICAgICAgICAgLy8gQ2hlY2sgdGhlIGVuY29kZWQgYnl0ZSB2YWx1ZSAodGhlIDIgY2hhcnMgYWZ0ZXIgdGhlICc9JykNCiAgICAgICAgICAgICAgICAkaGV4ID0gc3Vic3RyKCRlbmNvZGVkVGV4dCwgJG1heExlbmd0aCAtICRsb29rQmFjayArICRlbmNvZGVkQ2hhclBvcyArIDEsIDIpOw0KICAgICAgICAgICAgICAgICRkZWMgPSBoZXhkZWMoJGhleCk7DQogICAgICAgICAgICAgICAgaWYgKCRkZWMgPCAxMjgpIHsNCiAgICAgICAgICAgICAgICAgICAgLy8gU2luZ2xlIGJ5dGUgY2hhcmFjdGVyLg0KICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgZW5jb2RlZCBjaGFyIHdhcyBmb3VuZCBhdCBwb3MgMCwgaXQgd2lsbCBmaXQNCiAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIHJlZHVjZSBtYXhMZW5ndGggdG8gc3RhcnQgb2YgdGhlIGVuY29kZWQgY2hhcg0KICAgICAgICAgICAgICAgICAgICBpZiAoJGVuY29kZWRDaGFyUG9zID4gMCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1heExlbmd0aCA9ICRtYXhMZW5ndGggLSAoJGxvb2tCYWNrIC0gJGVuY29kZWRDaGFyUG9zKTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAkZm91bmRTcGxpdFBvcyA9IHRydWU7DQogICAgICAgICAgICAgICAgfSBlbHNlaWYgKCRkZWMgPj0gMTkyKSB7DQogICAgICAgICAgICAgICAgICAgIC8vIEZpcnN0IGJ5dGUgb2YgYSBtdWx0aSBieXRlIGNoYXJhY3Rlcg0KICAgICAgICAgICAgICAgICAgICAvLyBSZWR1Y2UgbWF4TGVuZ3RoIHRvIHNwbGl0IGF0IHN0YXJ0IG9mIGNoYXJhY3Rlcg0KICAgICAgICAgICAgICAgICAgICAkbWF4TGVuZ3RoID0gJG1heExlbmd0aCAtICgkbG9va0JhY2sgLSAkZW5jb2RlZENoYXJQb3MpOw0KICAgICAgICAgICAgICAgICAgICAkZm91bmRTcGxpdFBvcyA9IHRydWU7DQogICAgICAgICAgICAgICAgfSBlbHNlaWYgKCRkZWMgPCAxOTIpIHsNCiAgICAgICAgICAgICAgICAgICAgLy8gTWlkZGxlIGJ5dGUgb2YgYSBtdWx0aSBieXRlIGNoYXJhY3RlciwgbG9vayBmdXJ0aGVyIGJhY2sNCiAgICAgICAgICAgICAgICAgICAgJGxvb2tCYWNrICs9IDM7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAvLyBObyBlbmNvZGVkIGNoYXJhY3RlciBmb3VuZA0KICAgICAgICAgICAgICAgICRmb3VuZFNwbGl0UG9zID0gdHJ1ZTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICByZXR1cm4gJG1heExlbmd0aDsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBBcHBseSB3b3JkIHdyYXBwaW5nIHRvIHRoZSBtZXNzYWdlIGJvZHkuDQogICAgICogV3JhcHMgdGhlIG1lc3NhZ2UgYm9keSB0byB0aGUgbnVtYmVyIG9mIGNoYXJzIHNldCBpbiB0aGUgV29yZFdyYXAgcHJvcGVydHkuDQogICAgICogWW91IHNob3VsZCBvbmx5IGRvIHRoaXMgdG8gcGxhaW4tdGV4dCBib2RpZXMgYXMgd3JhcHBpbmcgSFRNTCB0YWdzIG1heSBicmVhayB0aGVtLg0KICAgICAqIFRoaXMgaXMgY2FsbGVkIGF1dG9tYXRpY2FsbHkgYnkgY3JlYXRlQm9keSgpLCBzbyB5b3UgZG9uJ3QgbmVlZCB0byBjYWxsIGl0IHlvdXJzZWxmLg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIHNldFdvcmRXcmFwKCkNCiAgICB7DQogICAgICAgIGlmICgkdGhpcy0+V29yZFdyYXAgPCAxKSB7DQogICAgICAgICAgICByZXR1cm47DQogICAgICAgIH0NCg0KICAgICAgICBzd2l0Y2ggKCR0aGlzLT5tZXNzYWdlX3R5cGUpIHsNCiAgICAgICAgICAgIGNhc2UgJ2FsdCc6DQogICAgICAgICAgICBjYXNlICdhbHRfaW5saW5lJzoNCiAgICAgICAgICAgIGNhc2UgJ2FsdF9hdHRhY2gnOg0KICAgICAgICAgICAgY2FzZSAnYWx0X2lubGluZV9hdHRhY2gnOg0KICAgICAgICAgICAgICAgICR0aGlzLT5BbHRCb2R5ID0gJHRoaXMtPndyYXBUZXh0KCR0aGlzLT5BbHRCb2R5LCAkdGhpcy0+V29yZFdyYXApOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgICAgICAkdGhpcy0+Qm9keSA9ICR0aGlzLT53cmFwVGV4dCgkdGhpcy0+Qm9keSwgJHRoaXMtPldvcmRXcmFwKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgfQ0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIEFzc2VtYmxlIG1lc3NhZ2UgaGVhZGVycy4NCiAgICAgKiBAYWNjZXNzIHB1YmxpYw0KICAgICAqIEByZXR1cm4gc3RyaW5nIFRoZSBhc3NlbWJsZWQgaGVhZGVycw0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBjcmVhdGVIZWFkZXIoKQ0KICAgIHsNCiAgICAgICAgJHJlc3VsdCA9ICcnOw0KDQogICAgICAgIGlmICgkdGhpcy0+TWVzc2FnZURhdGUgPT0gJycpIHsNCiAgICAgICAgICAgICR0aGlzLT5NZXNzYWdlRGF0ZSA9IHNlbGY6OnJmY0RhdGUoKTsNCiAgICAgICAgfQ0KICAgICAgICAkcmVzdWx0IC49ICR0aGlzLT5oZWFkZXJMaW5lKCdEYXRlJywgJHRoaXMtPk1lc3NhZ2VEYXRlKTsNCg0KICAgICAgICAvLyBUbyBiZSBjcmVhdGVkIGF1dG9tYXRpY2FsbHkgYnkgbWFpbCgpDQogICAgICAgIGlmICgkdGhpcy0+U2luZ2xlVG8pIHsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+TWFpbGVyICE9ICdtYWlsJykgew0KICAgICAgICAgICAgICAgIGZvcmVhY2ggKCR0aGlzLT50byBhcyAkdG9hZGRyKSB7DQogICAgICAgICAgICAgICAgICAgICR0aGlzLT5TaW5nbGVUb0FycmF5W10gPSAkdGhpcy0+YWRkckZvcm1hdCgkdG9hZGRyKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICBpZiAoY291bnQoJHRoaXMtPnRvKSA+IDApIHsNCiAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPk1haWxlciAhPSAnbWFpbCcpIHsNCiAgICAgICAgICAgICAgICAgICAgJHJlc3VsdCAuPSAkdGhpcy0+YWRkckFwcGVuZCgnVG8nLCAkdGhpcy0+dG8pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0gZWxzZWlmIChjb3VudCgkdGhpcy0+Y2MpID09IDApIHsNCiAgICAgICAgICAgICAgICAkcmVzdWx0IC49ICR0aGlzL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nDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGdldE1haWxNSU1FKCkNCiAgICB7DQogICAgICAgICRyZXN1bHQgPSAnJzsNCiAgICAgICAgJGlzbXVsdGlwYXJ0ID0gdHJ1ZTsNCiAgICAgICAgc3dpdGNoICgkdGhpcy0+bWVzc2FnZV90eXBlKSB7DQogICAgICAgICAgICBjYXNlICdpbmxpbmUnOg0KICAgICAgICAgICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPmhlYWRlckxpbmUoJ0NvbnRlbnQtVHlwZScsICdtdWx0aXBhcnQvcmVsYXRlZDsnKTsNCiAgICAgICAgICAgICAgICAkcmVzdWx0IC49ICR0aGlzLT50ZXh0TGluZSgiXHRib3VuZGFyeT1cIiIgLiAkdGhpcy0+Ym91bmRhcnlbMV0gLiAnIicpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAnYXR0YWNoJzoNCiAgICAgICAgICAgIGNhc2UgJ2lubGluZV9hdHRhY2gnOg0KICAgICAgICAgICAgY2FzZSAnYWx0X2F0dGFjaCc6DQogICAgICAgICAgICBjYXNlICdhbHRfaW5saW5lX2F0dGFjaCc6DQogICAgICAgICAgICAgICAgJHJlc3VsdCAuPSAkdGhpcy0+aGVhZGVyTGluZSgnQ29udGVudC1UeXBlJywgJ211bHRpcGFydC9taXhlZDsnKTsNCiAgICAgICAgICAgICAgICAkcmVzdWx0IC49ICR0aGlzLT50ZXh0TGluZSgiXHRib3VuZGFyeT1cIiIgLiAkdGhpcy0+Ym91bmRhcnlbMV0gLiAnIicpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAnYWx0JzoNCiAgICAgICAgICAgIGNhc2UgJ2FsdF9pbmxpbmUnOg0KICAgICAgICAgICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPmhlYWRlckxpbmUoJ0NvbnRlbnQtVHlwZScsICdtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7Jy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ym91bmRhcnlbMV0sICRib2R5Q2hhclNldCwgJycsICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkJvZHksICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRSAuICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+YXR0YWNoQWxsKCdhdHRhY2htZW50JywgJHRoaXMtPmJvdW5kYXJ5WzFdKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgJ2lubGluZV9hdHRhY2gnOg0KICAgICAgICAgICAgICAgICRib2R5IC49ICRtaW1lcHJlOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT50ZXh0TGluZSgnLS0nIC4gJHRoaXMtPmJvdW5kYXJ5WzFdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+aGVhZGVyTGluZSgnQ29udGVudC1UeXBlJywgJ211bHRpcGFydC9yZWxhdGVkOycpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT50ZXh0TGluZSgiXHRib3VuZGFyeT1cIiIgLiAkdGhpcy0+Ym91bmRhcnlbMl0gLiAnIicpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+Z2V0Qm91bmRhcnkoJHRoaXMtPmJvdW5kYXJ5WzJdLCAkYm9keUNoYXJTZXQsICcnLCAkYm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+ZW5jb2RlU3RyaW5nKCR0aGlzLT5Cb2R5LCAkYm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmF0dGFjaEFsbCgnaW5saW5lJywgJHRoaXMtPmJvdW5kYXJ5WzJdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmF0dGFjaEFsbCgnYXR0YWNobWVudCcsICR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdhbHQnOg0KICAgICAgICAgICAgICAgICRib2R5IC49ICRtaW1lcHJlOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5nZXRCb3VuZGFyeSgkdGhpcy0+Ym91bmRhcnlbMV0sICRhbHRCb2R5Q2hhclNldCwgJ3RleHQvcGxhaW4nLCAkYWx0Qm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+ZW5jb2RlU3RyaW5nKCR0aGlzLT5BbHRCb2R5LCAkYWx0Qm9keUVuY29kaW5nKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmdldEJvdW5kYXJ5KCR0aGlzLT5ib3VuZGFyeVsxXSwgJGJvZHlDaGFyU2V0LCAndGV4dC9odG1sJywgJGJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmVuY29kZVN0cmluZygkdGhpcy0+Qm9keSwgJGJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPkxFIC4gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJHRoaXMtPkljYWwpKSB7DQogICAgICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5nZXRCb3VuZGFyeSgkdGhpcy0+Ym91bmRhcnlbMV0sICcnLCAndGV4dC9jYWxlbmRhcjsgbWV0aG9kPVJFUVVFU1QnLCAnJyk7DQogICAgICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkljYWwsICR0aGlzLT5FbmNvZGluZyk7DQogICAgICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRSAuICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmVuZEJvdW5kYXJ5KCR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdhbHRfaW5saW5lJzoNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkbWltZXByZTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+Z2V0Qm91bmRhcnkoJHRoaXMtPmJvdW5kYXJ5WzFdLCAkYWx0Qm9keUNoYXJTZXQsICd0ZXh0L3BsYWluJywgJGFsdEJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmVuY29kZVN0cmluZygkdGhpcy0+QWx0Qm9keSwgJGFsdEJvZHlFbmNvZGluZyk7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPkxFIC4gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT50ZXh0TGluZSgnLS0nIC4gJHRoaXMtPmJvdW5kYXJ5WzFdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+aGVhZGVyTGluZSgnQ29udGVudC1UeXBlJywgJ211bHRpcGFydC9yZWxhdGVkOycpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT50ZXh0TGluZSgiXHRib3VuZGFyeT1cIiIgLiAkdGhpcy0+Ym91bmRhcnlbMl0gLiAnIicpOw0KICAgICAgICAgICAg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mcoJHRoaXMtPkJvZHksICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRSAuICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+YXR0YWNoQWxsKCdpbmxpbmUnLCAkdGhpcy0+Ym91bmRhcnlbM10pOw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+ZW5kQm91bmRhcnkoJHRoaXMtPmJvdW5kYXJ5WzJdKTsNCiAgICAgICAgICAgICAgICAkYm9keSAuPSAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgJGJvZHkgLj0gJHRoaXMtPmF0dGFjaEFsbCgnYXR0YWNobWVudCcsICR0aGlzLT5ib3VuZGFyeVsxXSk7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgIC8vIGNhdGNoIGNhc2UgJ3BsYWluJyBhbmQgY2FzZSAnJw0KICAgICAgICAgICAgICAgICRib2R5IC49ICR0aGlzLT5lbmNvZGVTdHJpbmcoJHRoaXMtPkJvZHksICRib2R5RW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQoNCiAgICAgICAgaWYgKCR0aGlzLT5pc0Vycm9yKCkpIHsNCiAgICAgICAgICAgICRib2R5ID0gJyc7DQogICAgICAgIH0gZWxzZWlmICgkdGhpcy0+c2lnbl9rZXlfZmlsZSkgew0KICAgICAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgICAgICBpZiAoIWRlZmluZWQoJ1BLQ1M3X1RFWFQnKSkgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgcGhwbWFpbGVyRXhjZXB0aW9uKCR0aGlzLT5sYW5nKCdleHRlbnNpb25fbWlzc2luZycpIC4gJ29wZW5zc2wnKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgLy8gQFRPRE8gd291bGQgYmUgbmljZSB0byB1c2UgcGhwOi8vdGVtcCBzdHJlYW1zIGhlcmUsIGJ1dCBuZWVkIHRvIHdyYXAgZm9yIFBIUCA8IDUuMQ0KICAgICAgICAgICAgICAgICRmaWxlID0gdGVtcG5hbShzeXNfZ2V0X3RlbXBfZGlyKCksICdtYWlsJyk7DQogICAgICAgICAgICAgICAgaWYgKGZhbHNlID09PSBmaWxlX3B1dF9jb250ZW50cygkZmlsZSwgJGJvZHkpKSB7DQogICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ3NpZ25pbmcnKSAuICcgQ291bGQgbm90IHdyaXRlIHRlbXAgZmlsZScpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAkc2lnbmVkID0gdGVtcG5hbShzeXNfZ2V0X3RlbXBfZGlyKCksICdzaWduZWQnKTsNCiAgICAgICAgICAgICAgICAvL1dvcmthcm91bmQgZm9yIFBIUCBidWcgaHR0cHM6Ly9idWdzLnBocC5uZXQvYnVnLnBocD9pZD02OTE5Nw0KICAgICAgICAgICAgICAgIGlmIChlbXB0eSgkdGhpcy0+c2lnbl9leHRyYWNlcnRzX2ZpbGUpKSB7DQogICAgICAgICAgICAgICAgICAgICRzaWduID0gQG9wZW5zc2xfcGtjczdfc2lnbigNCiAgICAgICAgICAgICAgICAgICAgICAgICRmaWxlLA0KICAgICAgICAgICAgICAgICAgICAgICAgJHNpZ25lZCwNCiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxlOi8vJyAuIHJlYWxwYXRoKCR0aGlzLT5zaWduX2NlcnRfZmlsZSksDQogICAgICAgICAgICAgICAgICAgICAgICBhcnJheSgnZmlsZTovLycgLiByZWFscGF0aCgkdGhpcy0+c2lnbl9rZXlfZmlsZSksICR0aGlzLT5zaWduX2tleV9wYXNzKSwNCiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwNCiAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkc2lnbiA9IEBvcGVuc3NsX3BrY3M3X3NpZ24oDQogICAgICAgICAgICAgICAgICAgICAgICAkZmlsZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICRzaWduZWQsDQogICAgICAgICAgICAgICAgICAgICAgICAnZmlsZTovLycgLiByZWFscGF0aCgkdGhpcy0+c2lnbl9jZXJ0X2ZpbGUpLA0KICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXkoJ2ZpbGU6Ly8nIC4gcmVhbHBhdGgoJHRoaXMtPnNpZ25fa2V5X2ZpbGUpLCAkdGhpcy0+c2lnbl9rZXlfcGFzcyksDQogICAgICAgICAgICAgICAgICAgICAgICBudWxsLA0KICAgICAgICAgICAgICAgICAgICAgICAgUEtDUzdfREVUQUNIRUQsDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+c2lnbl9leHRyYWNlcnRzX2ZpbGUNCiAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgaWYgKCRzaWduKSB7DQogICAgICAgICAgICAgICAgICAgIEB1bmxpbmsoJGZpbGUpOw0KICAgICAgICAgICAgICAgICAgICAkYm9keSA9IGZpbGVfZ2V0X2NvbnRlbnRzKCRzaWduZWQpOw0KICAgICAgICAgICAgICAgICAgICBAdW5saW5rKCRzaWduZWQpOw0KICAgICAgICAgICAgICAgICAgICAvL1RoZSBtZXNzYWdlIHJldHVybmVkIGJ5IG9wZW5zc2wgY29udGFpbnMgYm90aCBoZWFkZXJzIGFuZCBib2R5LCBzbyBuZWVkIHRvIHNwbGl0IHRoZW0gdXANCiAgICAgICAgICAgICAgICAgICAgJHBhcnRzID0gZXhwbG9kZSgiXG5cbiIsICRib2R5LCAyKTsNCiAgICAgICAgICAgICAgICAgICAgJHRoaXMtPk1JTUVIZWFkZXIgLj0gJHBhcnRzWzBdIC4gJHRoaXMtPkxFIC4gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgICAgICAkYm9keSA9ICRwYXJ0c1sxXTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICBAdW5saW5rKCRmaWxlKTsNCiAgICAgICAgICAgICAgICAgICAgQHVubGluaygkc2lnbmVkKTsNCiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnc2lnbmluZycpIC4gb3BlbnNzbF9lcnJvcl9zdHJpbmcoKSk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSBjYXRjaCAocGhwbWFpbGVyRXhjZXB0aW9uICRleGMpIHsNCiAgICAgICAgICAgICAgICAkYm9keSA9ICcnOw0KICAgICAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICByZXR1cm4gJGJvZHk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogUmV0dXJuIHRoZSBzdGFydCBvZiBhIG1lc3NhZ2UgYm91bmRhcnkuDQogICAgICogQGFjY2VzcyBwcm90ZWN0ZWQNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRib3VuZGFyeQ0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGNoYXJTZXQNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRjb250ZW50VHlwZQ0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGVuY29kaW5nDQogICAgICogQHJldHVybiBzdHJpbmcNCiAgICAgKi8NCiAgICBwcm90ZWN0ZWQgZnVuY3Rpb24gZ2V0Qm91bmRhcnkoJGJvdW5kYXJ5LCAkY2hhclNldCwgJGNvbnRlbnRUeXBlLCAkZW5jb2RpbmcpDQogICAgew0KICAgICAgICAkcmVzdWx0ID0gJyc7DQogICAgICAgIGlmICgkY2hhclNldCA9PSAnJykgew0KICAgICAgICAgICAgJGNoYXJTZXQgPSAkdGhpcy0+Q2hhclNldDsNCiAgICAgICAgfQ0KICAgICAgICBpZiAoJGNvbnRlbnRUeXBlID09ICcnKSB7DQogICAgICAgICAgICAkY29udGVudFR5cGUgPSAkdGhpcy0+Q29udGVudFR5cGU7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCRlbmNvZGluZyA9PSAnJykgew0KICAgICAgICAgICAgJGVuY29kaW5nID0gJHRoaXMtPkVuY29kaW5nOw0KICAgICAgICB9DQogICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPnRleHRMaW5lKCctLScgLiAkYm91bmRhcnkpOw0KICAgICAgICAkcmVzdWx0IC49IHNwcmludGYoJ0NvbnRlbnQtVHlwZTogJXM7IGNoYXJzZXQ9JXMnLCAkY29udGVudFR5cGUsICRjaGFyU2V0KTsNCiAgICAgICAgJHJlc3VsdCAuPSAkdGhpcy0+TEU7DQogICAgICAgIC8vIFJGQzEzNDEgcGFydCA1IHNheXMgN2JpdCBpcyBhc3N1bWVkIGlmIG5vdCBzcGVjaWZpZWQNCiAgICAgICAgaWYgKCRlbmNvZGluZyAhPSAnN2JpdCcpIHsNCiAgICAgICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPmhlYWRlckxpbmUoJ0NvbnRlbnQtVHJhbnNmZXItRW5jb2RpbmcnLCAkZW5jb2RpbmcpOw0KICAgICAgICB9DQogICAgICAgICRyZXN1bHQgLj0gJHRoaXMtPkxFOw0KDQogICAgICAgIHJldHVybiAkcmVzdWx0Ow0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFJldHVybiB0aGUgZW5kIG9mIGEgbWVzc2FnZSBib3VuZGFyeS4NCiAgICAgKiBAYWNjZXNzIHByb3RlY3RlZA0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGJvdW5kYXJ5DQogIC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RmlsZSBleHRlbnNpb24gKE1JTUUpIHR5cGUuDQogICAgICogQHBhcmFtIHN0cmluZyAkZGlzcG9zaXRpb24gRGlzcG9zaXRpb24gdG8gdXNlDQogICAgICogQHRocm93cyBwaHBtYWlsZXJFeGNlcHRpb24NCiAgICAgKiBAcmV0dXJuIGJvb2xlYW4NCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gYWRkQXR0YWNobWVudCgkcGF0aCwgJG5hbWUgPSAnJywgJGVuY29kaW5nID0gJ2Jhc2U2NCcsICR0eXBlID0gJycsICRkaXNwb3NpdGlvbiA9ICdhdHRhY2htZW50JykNCiAgICB7DQogICAgICAgIHRyeSB7DQogICAgICAgICAgICBpZiAoIUBpc19maWxlKCRwYXRoKSkgew0KICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2ZpbGVfYWNjZXNzJykgLiAkcGF0aCwgc2VsZjo6U1RPUF9DT05USU5VRSk7DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIC8vIElmIGEgTUlNRSB0eXBlIGlzIG5vdCBzcGVjaWZpZWQsIHRyeSB0byB3b3JrIGl0IG91dCBmcm9tIHRoZSBmaWxlIG5hbWUNCiAgICAgICAgICAgIGlmICgkdHlwZSA9PSAnJykgew0KICAgICAgICAgICAgICAgICR0eXBlID0gc2VsZjo6ZmlsZW5hbWVUb1R5cGUoJHBhdGgpOw0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAkZmlsZW5hbWUgPSBiYXNlbmFtZSgkcGF0aCk7DQogICAgICAgICAgICBpZiAoJG5hbWUgPT0gJycpIHsNCiAgICAgICAgICAgICAgICAkbmFtZSA9ICRmaWxlbmFtZTsNCiAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgJHRoaXMtPmF0dGFjaG1lbnRbXSA9IGFycmF5KA0KICAgICAgICAgICAgICAgIDAgPT4gJHBhdGgsDQogICAgICAgICAgICAgICAgMSA9PiAkZmlsZW5hbWUsDQogICAgICAgICAgICAgICAgMiA9PiAkbmFtZSwNCiAgICAgICAgICAgICAgICAzID0+ICRlbmNvZGluZywNCiAgICAgICAgICAgICAgICA0ID0+ICR0eXBlLA0KICAgICAgICAgICAgICAgIDUgPT4gZmFsc2UsIC8vIGlzU3RyaW5nQXR0YWNobWVudA0KICAgICAgICAgICAgICAgIDYgPT4gJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgICAgIDcgPT4gMA0KICAgICAgICAgICAgKTsNCg0KICAgICAgICB9IGNhdGNoIChwaHBtYWlsZXJFeGNlcHRpb24gJGV4Yykgew0KICAgICAgICAgICAgJHRoaXMtPnNldEVycm9yKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICAkdGhpcy0+ZWRlYnVnKCRleGMtPmdldE1lc3NhZ2UoKSk7DQogICAgICAgICAgICBpZiAoJHRoaXMtPmV4Y2VwdGlvbnMpIHsNCiAgICAgICAgICAgICAgICB0aHJvdyAkZXhjOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFJldHVybiB0aGUgYXJyYXkgb2YgYXR0YWNobWVudHMuDQogICAgICogQHJldHVybiBhcnJheQ0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBnZXRBdHRhY2htZW50cygpDQogICAgew0KICAgICAgICByZXR1cm4gJHRoaXMtPmF0dGFjaG1lbnQ7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogQXR0YWNoIGFsbCBmaWxlLCBzdHJpbmcsIGFuZCBiaW5hcnkgYXR0YWNobWVudHMgdG8gdGhlIG1lc3NhZ2UuDQogICAgICogUmV0dXJucyBhbiBlbXB0eSBzdHJpbmcgb24gZmFpbHVyZS4NCiAgICAgKiBAYWNjZXNzIHByb3RlY3RlZA0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGRpc3Bvc2l0aW9uX3R5cGUNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRib3VuZGFyeQ0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIGF0dGFjaEFsbCgkZGlzcG9zaXRpb25fdHlwZSwgJGJvdW5kYXJ5KQ0KICAgIHsNCiAgICAgICAgLy8gUmV0dXJuIHRleHQgb2YgYm9keQ0KICAgICAgICAkbWltZSA9IGFycmF5KCk7DQogICAgICAgICRjaWRVbmlxID0gYXJyYXkoKTsNCiAgICAgICAgJGluY2wgPSBhcnJheSgpOw0KDQogICAgICAgIC8vIEFkZCBhbGwgYXR0YWNobWVudHMNCiAgICAgICAgZm9yZWFjaCAoJHRoaXMtPmF0dGFjaG1lbnQgYXMgJGF0dGFjaG1lbnQpIHsNCiAgICAgICAgICAgIC8vIENoZWNrIGlmIGl0IGlzIGEgdmFsaWQgZGlzcG9zaXRpb25fZmlsdGVyDQogICAgICAgICAgICBpZiAoJGF0dGFjaG1lbnRbNl0gPT0gJGRpc3Bvc2l0aW9uX3R5cGUpIHsNCiAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3Igc3RyaW5nIGF0dGFjaG1lbnQNCiAgICAgICAgICAgICAgICAkc3RyaW5nID0gJyc7DQogICAgICAgICAgICAgICAgJHBhdGggPSAnJzsNCiAgICAgICAgICAgICAgICAkYlN0cmluZyA9ICRhdHRhY2htZW50WzVdOw0KICAgICAgICAgICAgICAgIGlmICgkYlN0cmluZykgew0KICAgICAgICAgICAgICAgICAgICAkc3RyaW5nID0gJGF0dGFjaG1lbnRbMF07DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJHBhdGggPSAkYXR0YWNobWVudFswXTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAkaW5jbGhhc2ggPSBtZDUoc2VyaWFsaXplKCRhdHRhY2htZW50KSk7DQogICAgICAgICAgICAgICAgaWYgKGluX2FycmF5KCRpbmNsaGFzaCwgJGluY2wpKSB7DQogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAkaW5jbFtdID0gJGluY2xoYXNoOw0KICAgICAgICAgICAgICAgICRuYW1lID0gJGF0dGFjaG1lbnRbMl07DQogICAgICAgICAgICAgICAgJGVuY29kaW5nID0gJGF0dGFjaG1lbnRbM107DQogICAgICAgICAgICAgICAgJHR5cGUgPSAkYXR0YWNobWVudFs0XTsNCiAgICAgICAgICAgICAgICAkZGlzcG9zaXRpb24gPSAkYXR0YWNobWVudFs2XTsNCiAgICAgICAgICAgICAgICAkY2lkID0gJGF0dGFjaG1lbnRbN107DQogICAgICAgICAgICAgICAgaWYgKCRkaXNwb3NpdGlvbiA9PSAnaW5saW5lJyAmJiBhcnJheV9rZXlfZXhpc3RzKCRjaWQsICRjaWRVbmlxKSkgew0KICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgJGNpZFVuaXFbJGNpZF0gPSB0cnVlOw0KDQogICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoJy0tJXMlcycsICRib3VuZGFyeSwgJHRoaXMtPkxFKTsNCiAgICAgICAgICAgICAgICAvL09ubHkgaW5jbHVkZSBhIGZpbGVuYW1lIHByb3BlcnR5IGlmIHdlIGhhdmUgb25lDQogICAgICAgICAgICAgICAgaWYgKCFlbXB0eSgkbmFtZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoDQogICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlOiAlczsgbmFtZT0iJXMiJXMnLA0KICAgICAgICAgICAgICAgICAgICAgICAgJHR5cGUsDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+ZW5jb2RlSGVhZGVyKCR0aGlzLT5zZWN1cmVIZWFkZXIoJG5hbWUpKSwNCiAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICRtaW1lW10gPSBzcHJpbnRmKA0KICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZTogJXMlcycsDQogICAgICAgICAgICAgICAgICAgICAgICAkdHlwZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAvLyBSRkMxMzQxIHBhcnQgNSBzYXlzIDdiaXQgaXMgYXNzdW1lZCBpZiBub3Qgc3BlY2lmaWVkDQogICAgICAgICAgICAgICAgaWYgKCRlbmNvZGluZyAhPSAnN2JpdCcpIHsNCiAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoJ0NvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6ICVzJXMnLCAkZW5jb2RpbmcsICR0aGlzLT5MRSk7DQogICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgaWYgKCRkaXNwb3NpdGlvbiA9PSAnaW5saW5lJykgew0KICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gc3ByaW50ZignQ29udGVudC1JRDogPCVzPiVzJywgJGNpZCwgJHRoaXMtPkxFKTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICAvLyBJZiBhIGZpbGVuYW1lIGNvbnRhaW5zIGFueSBvZiB0aGVzZSBjaGFycywgaXQgc2hvdWxkIGJlIHF1b3RlZCwNCiAgICAgICAgICAgICAgICAvLyBidXQgbm90IG90aGVyd2lzZTogUkZDMjE4MyAmIFJGQzIwNDUgNS4xDQogICAgICAgICAgICAgICAgLy8gRml4ZXMgYSB3YXJuaW5nIGluIElFVEYncyBtc2dsaW50IE1JTUUgY2hlY2tlcg0KICAgICAgICAgICAgICAgIC8vIEFsbG93IGZvciBieXBhc3NpbmcgdGhlIENvbnRlbnQtRGlzcG9zaXRpb24gaGVhZGVyIHRvdGFsbHkNCiAgICAgICAgICAgICAgICBpZiAoIShlbXB0eSgkZGlzcG9zaXRpb24pKSkgew0KICAgICAgICAgICAgICAgICAgICAkZW5jb2RlZF9uYW1lID0gJHRoaXMtPmVuY29kZUhlYWRlcigkdGhpcy0+c2VjdXJlSGVhZGVyKCRuYW1lKSk7DQogICAgICAgICAgICAgICAgICAgIGlmIChwcmVnX21hdGNoKCcvWyBcKFwpPD5ALDs6XFwiXC9cW1xdXD89XS8nLCAkZW5jb2RlZF9uYW1lKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtRGlzcG9zaXRpb246ICVzOyBmaWxlbmFtZT0iJXMiJXMnLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkaXNwb3NpdGlvbiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW5jb2RlZF9uYW1lLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRSAuICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJGVuY29kZWRfbmFtZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gc3ByaW50ZigNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtRGlzcG9zaXRpb246ICVzOyBmaWxlbmFtZT0lcyVzJywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW5jb2RlZF9uYW1lLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+TEUgLiAkdGhpcy0+TEUNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gc3ByaW50ZigNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtRGlzcG9zaXRpb246ICVzJXMnLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGlzcG9zaXRpb24sDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5MRSAuICR0aGlzLT5MRQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gJHRoaXMtPkxFOw0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIC8vIEVuY29kZSBhcyBzdHJpbmcgYXR0YWNobWVudA0KICAgICAgICAgICAgICAgIGlmICgkYlN0cmluZykgew0KICAgICAgICAgICAgICAgICAgICAkbWltZVtdID0gJHRoaXMtPmVuY29kZVN0cmluZygkc3RyaW5nLCAkZW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPmlzRXJyb3IoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRtaW1lW10gPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgJG1pbWVbXSA9ICR0aGlzLT5lbmNvZGVGaWxlKCRwYXRoLCAkZW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPmlzRXJyb3IoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRtaW1lW10gPSAkdGhpcy0+TEUgLiAkdGhpcy0+TEU7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQoNCiAgICAgICAgJG1pbWVbXSA9IHNwcmludGYoJy0tJXMtLSVzJywgJGJvdW5kYXJ5LCAkdGhpcy0+TEUpOw0KDQogICAgICAgIHJldHVybiBpbXBsb2RlKCcnLCAkbWltZSk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogRW5jb2RlIGEgZmlsZSBhdHRhY2htZW50IGluIHJlcXVlc3RlZCBmb3JtYXQuDQogICAgICogUmV0dXJucyBhbiBlbXB0eSBzdHJpbmcgb24gZmFpbHVyZS4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRwYXRoIFRoZSBmdWxsIHBhdGggdG8gdGhlIGZpbGUNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRlbmNvZGluZyBUaGUgZW5jb2RpbmcgdG8gdXNlOyBvbmUgb2YgJ2Jhc2U2NCcsICc3Yml0JywgJzhiaXQnLCAnYmluYXJ5JywgJ3F1b3RlZC1wcmludGFibGUnDQogICAgICogQHRocm93cyBwaHBtYWlsZXJFeGNlcHRpb24NCiAgICAgKiBAYWNjZXNzIHByb3RlY3RlZA0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIGVuY29kZUZpbGUoJHBhdGgsICRlbmNvZGluZyA9ICdiYXNlNjQnKQ0KICAgIHsNCiAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgIGlmICghaXNfcmVhZGFibGUoJHBhdGgpKSB7DQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IHBocG1haWxlckV4Y2VwdGlvbigkdGhpcy0+bGFuZygnZmlsZV9vcGVuJykgLiAkcGF0aCwgc2VsZjo6U1RPUF9DT05USU5VRSk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICAkbWFnaWNfcXVvdGVzID0gZ2V0X21hZ2ljX3F1b3Rlc19ydW50aW1lKCk7DQogICAgICAgICAgICBpZiAoJG1hZ2ljX3F1b3Rlcykgew0KICAgICAgICAgICAgICAgIGlmICh2ZXJzaW9uX2NvbXBhcmUoUEhQX1ZFUlNJT04sICc1LjMuMCcsICc8JykpIHsNCiAgICAgICAgICAgICAgICAgICAgc2V0X21hZ2ljX3F1b3Rlc19ydW50aW1lKGZhbHNlKTsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAvL0RvZXNuJ3QgZXhpc3QgaW4gUEhQIDUuNCwgYnV0IHdlIGRvbid0IG5lZWQgdG8gY2hlY2sgYmVjYXVzZQ0KICAgICAgICAgICAgICAgICAgICAvL2dldF9tYWdpY19xdW90ZXNfcnVudGltZSBhbHdheXMgcmV0dXJucyBmYWxzZSBpbiA1LjQrDQogICAgICAgICAgICAgICAgICAgIC8vc28gaXQgd2lsbCBuZXZlciBnZXQgaGVyZQ0KICAgICAgICAgICAgICAgICAgICBpbmlfc2V0KCdtYWdpY19xdW90ZXNfcnVudGltZScsIGZhbHNlKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICAkZmlsZV9idWZmZXIgPSBmaWxlX2dldF9jb250ZW50cygkcGF0aCk7DQogICAgICAgICAgICAkZmlsZV9idWZmZXIgPSAkdGhpcy0+ZW5jb2RlU3RyaW5nKCRmaWxlX2J1ZmZlciwgJGVuY29kaW5nKTsNCiAgICAgICAgICAgIGlmICgkbWFnaWNfcXVvdGVzKSB7DQogICAgICAgICAgICAgICAgaWYgKHZlcnNpb25fY29tcGFyZShQSFBfVkVSU0lPTiwgJzUuMy4wJywgJzwnKS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AgICAgICAgICAgICAkZW5jb2RlZCA9IGNodW5rX3NwbGl0KGJhc2U2NF9lbmNvZGUoJHN0ciksIDc2LCAkdGhpcy0+TEUpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAnN2JpdCc6DQogICAgICAgICAgICBjYXNlICc4Yml0JzoNCiAgICAgICAgICAgICAgICAkZW5jb2RlZCA9ICR0aGlzLT5maXhFT0woJHN0cik7DQogICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIGl0IGVuZHMgd2l0aCBhIGxpbmUgYnJlYWsNCiAgICAgICAgICAgICAgICBpZiAoc3Vic3RyKCRlbmNvZGVkLCAtKHN0cmxlbigkdGhpcy0+TEUpKSkgIT0gJHRoaXMtPkxFKSB7DQogICAgICAgICAgICAgICAgICAgICRlbmNvZGVkIC49ICR0aGlzLT5MRTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICdiaW5hcnknOg0KICAgICAgICAgICAgICAgICRlbmNvZGVkID0gJHN0cjsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgJ3F1b3RlZC1wcmludGFibGUnOg0KICAgICAgICAgICAgICAgICRlbmNvZGVkID0gJHRoaXMtPmVuY29kZVFQKCRzdHIpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgICAgICAkdGhpcy0+c2V0RXJyb3IoJHRoaXMtPmxhbmcoJ2VuY29kaW5nJykgLiAkZW5jb2RpbmcpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkZW5jb2RlZDsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBFbmNvZGUgYSBoZWFkZXIgc3RyaW5nIG9wdGltYWxseS4NCiAgICAgKiBQaWNrcyBzaG9ydGVzdCBvZiBRLCBCLCBxdW90ZWQtcHJpbnRhYmxlIG9yIG5vbmUuDQogICAgICogQGFjY2VzcyBwdWJsaWMNCiAgICAgKiBAcGFyYW0gc3RyaW5nICRzdHINCiAgICAgKiBAcGFyYW0gc3RyaW5nICRwb3NpdGlvbg0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGVuY29kZUhlYWRlcigkc3RyLCAkcG9zaXRpb24gPSAndGV4dCcpDQogICAgew0KICAgICAgICAkbWF0Y2hjb3VudCA9IDA7DQogICAgICAgIHN3aXRjaCAoc3RydG9sb3dlcigkcG9zaXRpb24pKSB7DQogICAgICAgICAgICBjYXNlICdwaHJhc2UnOg0KICAgICAgICAgICAgICAgIGlmICghcHJlZ19tYXRjaCgnL1tcMjAwLVwzNzddLycsICRzdHIpKSB7DQogICAgICAgICAgICAgICAgICAgIC8vIENhbid0IHVzZSBhZGRzbGFzaGVzIGFzIHdlIGRvbid0IGtub3cgdGhlIHZhbHVlIG9mIG1hZ2ljX3F1b3Rlc19zeWJhc2UNCiAgICAgICAgICAgICAgICAgICAgJGVuY29kZWQgPSBhZGRjc2xhc2hlcygkc3RyLCAiXDAuLlwzN1wxNzdcXFwiIik7DQogICAgICAgICAgICAgICAgICAgIGlmICgoJHN0ciA9PSAkZW5jb2RlZCkgJiYgIXByZWdfbWF0Y2goJy9bXkEtWmEtejAtOSEjJCUmXCcqK1wvPT9eX2B7fH1+IC1dLycsICRzdHIpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCRlbmNvZGVkKTsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoIlwiJGVuY29kZWRcIiIpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICRtYXRjaGNvdW50ID0gcHJlZ19tYXRjaF9hbGwoJy9bXlwwNDBcMDQxXDA0My1cMTMz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AgICAgICAgJHRoaXMtPnNldEVycm9yKCR0aGlzLT5sYW5nKCdmaWxlX2FjY2VzcycpIC4gJHBhdGgpOw0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICB9DQoNCiAgICAgICAgLy8gSWYgYSBNSU1FIHR5cGUgaXMgbm90IHNwZWNpZmllZCwgdHJ5IHRvIHdvcmsgaXQgb3V0IGZyb20gdGhlIGZpbGUgbmFtZQ0KICAgICAgICBpZiAoJHR5cGUgPT0gJycpIHsNCiAgICAgICAgICAgICR0eXBlID0gc2VsZjo6ZmlsZW5hbWVUb1R5cGUoJHBhdGgpOw0KICAgICAgICB9DQoNCiAgICAgICAgJGZpbGVuYW1lID0gYmFzZW5hbWUoJHBhdGgpOw0KICAgICAgICBpZiAoJG5hbWUgPT0gJycpIHsNCiAgICAgICAgICAgICRuYW1lID0gJGZpbGVuYW1lOw0KICAgICAgICB9DQoNCiAgICAgICAgLy8gQXBwZW5kIHRvICRhdHRhY2htZW50IGFycmF5DQogICAgICAgICR0aGlzLT5hdHRhY2htZW50W10gPSBhcnJheSgNCiAgICAgICAgICAgIDAgPT4gJHBhdGgsDQogICAgICAgICAgICAxID0+ICRmaWxlbmFtZSwNCiAgICAgICAgICAgIDIgPT4gJG5hbWUsDQogICAgICAgICAgICAzID0+ICRlbmNvZGluZywNCiAgICAgICAgICAgIDQgPT4gJHR5cGUsDQogICAgICAgICAgICA1ID0+IGZhbHNlLCAvLyBpc1N0cmluZ0F0dGFjaG1lbnQNCiAgICAgICAgICAgIDYgPT4gJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgNyA9PiAkY2lkDQogICAgICAgICk7DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIEFkZCBhbiBlbWJlZGRlZCBzdHJpbmdpZmllZCBhdHRhY2htZW50Lg0KICAgICAqIFRoaXMgY2FuIGluY2x1ZGUgaW1hZ2VzLCBzb3VuZHMsIGFuZCBqdXN0IGFib3V0IGFueSBvdGhlciBkb2N1bWVudCB0eXBlLg0KICAgICAqIEJlIHN1cmUgdG8gc2V0IHRoZSAkdHlwZSB0byBhbiBpbWFnZSB0eXBlIGZvciBpbWFnZXM6DQogICAgICogSlBFRyBpbWFnZXMgdXNlICdpbWFnZS9qcGVnJywgR0lGIHVzZXMgJ2ltYWdlL2dpZicsIFBORyB1c2VzICdpbWFnZS9wbmcnLg0KICAgICAqIEBwYXJhbSBzdHJpbmcgJHN0cmluZyBUaGUgYXR0YWNobWVudCBiaW5hcnkgZGF0YS4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRjaWQgQ29udGVudCBJRCBvZiB0aGUgYXR0YWNobWVudDsgVXNlIHRoaXMgdG8gcmVmZXJlbmNlDQogICAgICogICAgICAgIHRoZSBjb250ZW50IHdoZW4gdXNpbmcgYW4gZW1iZWRkZWQgaW1hZ2UgaW4gSFRNTC4NCiAgICAgKiBAcGFyYW0gc3RyaW5nICRuYW1lDQogICAgICogQHBhcmFtIHN0cmluZyAkZW5jb2RpbmcgRmlsZSBlbmNvZGluZyAoc2VlICRFbmNvZGluZykuDQogICAgICogQHBhcmFtIHN0cmluZyAkdHlwZSBNSU1FIHR5cGUuDQogICAgICogQHBhcmFtIHN0cmluZyAkZGlzcG9zaXRpb24gRGlzcG9zaXRpb24gdG8gdXNlDQogICAgICogQHJldHVybiBib29sZWFuIFRydWUgb24gc3VjY2Vzc2Z1bGx5IGFkZGluZyBhbiBhdHRhY2htZW50DQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGFkZFN0cmluZ0VtYmVkZGVkSW1hZ2UoDQogICAgICAgICRzdHJpbmcsDQogICAgICAgICRjaWQsDQogICAgICAgICRuYW1lID0gJycsDQogICAgICAgICRlbmNvZGluZyA9ICdiYXNlNjQnLA0KICAgICAgICAkdHlwZSA9ICcnLA0KICAgICAgICAkZGlzcG9zaXRpb24gPSAnaW5saW5lJw0KICAgICkgew0KICAgICAgICAvLyBJZiBhIE1JTUUgdHlwZSBpcyBub3Qgc3BlY2lmaWVkLCB0cnkgdG8gd29yayBpdCBvdXQgZnJvbSB0aGUgbmFtZQ0KICAgICAgICBpZiAoJHR5cGUgPT0gJycgYW5kICFlbXB0eSgkbmFtZSkpIHsNCiAgICAgICAgICAgICR0eXBlID0gc2VsZjo6ZmlsZW5hbWVUb1R5cGUoJG5hbWUpOw0KICAgICAgICB9DQoNCiAgICAgICAgLy8gQXBwZW5kIHRvICRhdHRhY2htZW50IGFycmF5DQogICAgICAgICR0aGlzLT5hdHRhY2htZW50W10gPSBhcnJheSgNCiAgICAgICAgICAgIDAgPT4gJHN0cmluZywNCiAgICAgICAgICAgIDEgPT4gJG5hbWUsDQogICAgICAgICAgICAyID0+ICRuYW1lLA0KICAgICAgICAgICAgMyA9PiAkZW5jb2RpbmcsDQogICAgICAgICAgICA0ID0+ICR0eXBlLA0KICAgICAgICAgICAgNSA9PiB0cnVlLCAvLyBpc1N0cmluZ0F0dGFjaG1lbnQNCiAgICAgICAgICAgIDYgPT4gJGRpc3Bvc2l0aW9uLA0KICAgICAgICAgICAgNyA9PiAkY2lkDQogICAgICAgICk7DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIENoZWNrIGlmIGFuIGlubGluZSBhdHRhY2htZW50IGlzIHByZXNlbnQuDQogICAgICogQGFjY2VzcyBwdWJsaWMNCiAgICAgKiBAcmV0dXJuIGJvb2xlYW4NCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gaW5saW5lSW1hZ2VFeGlzdHMoKQ0KICAgIHsNCiAgICAgICAgZm9yZWFjaCAoJHRoaXMtPmF0dGFjaG1lbnQgYXMgJGF0dGFjaG1lbnQpIHsNCiAgICAgICAgICAgIGlmICgkYXR0YWNobWVudFs2XSA9PSAnaW5saW5lJykgew0KICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJ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aCAoJFJlY2lwaWVudHNRdWV1ZSBhcyAkYWRkcmVzcyA9PiAkcGFyYW1zKSB7DQogICAgICAgICAgICBpZiAoJHBhcmFtc1swXSA9PSAka2luZCkgew0KICAgICAgICAgICAgICAgIHVuc2V0KCR0aGlzLT5SZWNpcGllbnRzUXVldWVbJGFkZHJlc3NdKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIENsZWFyIGFsbCBUbyByZWNpcGllbnRzLg0KICAgICAqIEByZXR1cm4gdm9pZA0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBjbGVhckFkZHJlc3NlcygpDQogICAgew0KICAgICAgICBmb3JlYWNoICgkdGhpcy0+dG8gYXMgJHRvKSB7DQogICAgICAgICAgICB1bnNldCgkdGhpcy0+YWxsX3JlY2lwaWVudHNbc3RydG9sb3dlcigkdG9bMF0pXSk7DQogICAgICAgIH0NCiAgICAgICAgJHRoaXMtPnRvID0gYXJyYXkoKTsNCiAgICAgICAgJHRoaXMtPmNsZWFyUXVldWVkQWRkcmVzc2VzKCd0bycpOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIENsZWFyIGFsbCBDQyByZWNpcGllbnRzLg0KICAgICAqIEByZXR1cm4gdm9pZA0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBjbGVhckNDcygpDQogICAgew0KICAgICAgICBmb3JlYWNoICgkdGhpcy0+Y2MgYXMgJGNjKSB7DQogICAgICAgICAgICB1bnNldCgkdGhpcy0+YWxsX3JlY2lwaWVudHNbc3RydG9sb3dlcigkY2NbMF0pXSk7DQogICAgICAgIH0NCiAgICAgICAgJHRoaXMtPmNjID0gYXJyYXkoKTsNCiAgICAgICAgJHRoaXMtPmNsZWFyUXVldWVkQWRkcmVzc2VzKCdjYycpOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIENsZWFyIGFsbCBCQ0MgcmVjaXBpZW50cy4NCiAgICAgKiB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0dGFjaG1lbnRzLg0KICAgICAqIEByZXR1cm4gdm9pZA0KICAgICAqLw0KICAgIHB1YmxpYyBmdW5jdGlvbiBjbGVhckF0dGFjaG1lbnRzKCkNCiAgICB7DQogICAgICAgICR0aGlzLT5hdHRhY2htZW50ID0gYXJyYXkoKTsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBDbGVhciBhbGwgY3VzdG9tIGhlYWRlcnMuDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGNsZWFyQ3VzdG9tSGVhZGVycygpDQogICAgew0KICAgICAgICAkdGhpcy0+Q3VzdG9tSGVhZGVyID0gYXJyYXkoKTsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBBZGQgYW4gZXJyb3IgbWVzc2FnZSB0byB0aGUgZXJyb3IgY29udGFpbmVyLg0KICAgICAqIEBhY2Nlc3MgcHJvdGVjdGVkDQogICAgICogQHBhcmFtIHN0cmluZyAkbXNnDQogICAgICogQHJldHVybiB2b2lkDQogICAgICovDQogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIHNldEVycm9yKCRtc2cpDQogICAgew0KICAgICAgICAkdGhpcy0+ZXJyb3JfY291bnQrKzsNCiAgICAgICAgaWYgKCR0aGlzLT5NYWlsZXIgPT0gJ3NtdHAnIGFuZCAhaXNfbnVsbCgkdGhpcy0+c210cCkpIHsNCiAgICAgICAgICAgICRsYXN0ZXJyb3IgPSAkdGhpcy0+c210cC0+Z2V0RXJyb3IoKTsNCiAgICAgICAgICAgIGlmICghZW1wdHkoJGxhc3RlcnJvclsnZXJyb3InXSkpIHsNCiAgICAgICAgICAgICAgICAkbXNnIC49ICR0aGlzLT5sYW5nKCdzbXRwX2Vycm9yJykgLiAkbGFzdGVycm9yWydlcnJvciddOw0KICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJGxhc3RlcnJvclsnZGV0YWlsJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICRtc2cgLj0gJyBE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BAYWNjZXNzIHByb3RlY3RlZA0KICAgICAqIEBwYXJhbSBzdHJpbmcgJGtleQ0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIGxhbmcoJGtleSkNCiAgICB7DQogICAgICAgIGlmIChjb3VudCgkdGhpcy0+bGFuZ3VhZ2UpIDwgMSkgew0KICAgICAgICAgICAgJHRoaXMtPnNldExhbmd1YWdlKCdlbicpOyAvLyBzZXQgdGhlIGRlZmF1bHQgbGFuZ3VhZ2UNCiAgICAgICAgfQ0KDQogICAgICAgIGlmIChhcnJheV9rZXlfZXhpc3RzKCRrZXksICR0aGlzLT5sYW5ndWFnZSkpIHsNCiAgICAgICAgICAgIGlmICgka2V5ID09ICdzbXRwX2Nvbm5lY3RfZmFpbGVkJykgew0KICAgICAgICAgICAgICAgIC8vSW5jbHVkZSBhIGxpbmsgdG8gdHJvdWJsZXNob290aW5nIGRvY3Mgb24gU01UUCBjb25uZWN0aW9uIGZhaWx1cmUNCiAgICAgICAgICAgICAgICAvL3RoaXMgaXMgYnkgZmFyIHRoZSBiaWdnZXN0IGNhdXNlIG9mIHN1cHBvcnQgcXVlc3Rpb25zDQogICAgICAgICAgICAgICAgLy9idXQgaXQncyB1c3VhbGx5IG5vdCBQSFBNYWlsZXIncyBmYXVsdC4NCiAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPmxhbmd1YWdlWyRrZXldIC4gJyBodHRwczovL2dpdGh1Yi5jb20vUEhQTWFpbGVyL1BIUE1haWxlci93aWtpL1Ryb3VibGVzaG9vdGluZyc7DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gJHRoaXMtPmxhbmd1YWdlWyRrZXldOw0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgLy9SZXR1cm4gdGhlIGtleSBhcyBhIGZhbGxiYWNrDQogICAgICAgICAgICByZXR1cm4gJGtleTsNCiAgICAgICAgfQ0KICAgIH0NCg0KICA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ICR1cmwsICRtYXRjaCkpIHsNCiAgICAgICAgICAgICAgICAgICAgJGRhdGEgPSBzdWJzdHIoJHVybCwgc3RycG9zKCR1cmwsICcsJykpOw0KICAgICAgICAgICAgICAgICAgICBpZiAoJG1hdGNoWzJdKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkZGF0YSA9IGJhc2U2NF9kZWNvZGUoJGRhdGEpOw0KICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgJGRhdGEgPSByYXd1cmxkZWNvZGUoJGRhdGEpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICRjaWQgPSBtZDUoJHVybCkgLiAnQHBocG1haWxlci4wJzsgLy8gUkZDMjM5MiBTIDINCiAgICAgICAgICAgICAgICAgICAgaWYgKCR0aGlzLT5hZGRTdHJpbmdFbWJlZGRlZEltYWdlKCRkYXRhLCAkY2lkLCAnZW1iZWQnIC4gJGltZ2luZGV4LCAnYmFzZTY0JywgJG1hdGNoWzFdKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2UgPSBzdHJfcmVwbGFjZSgNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaW1hZ2VzWzBdWyRpbWdpbmRleF0sDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGltYWdlc1sxXVskaW1naW5kZXhdIC4gJz0iY2lkOicgLiAkY2lkIC4gJyInLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRtZXNzYWdlDQogICAgICAgICAgICAgICAgICAgICAgICApOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfSBlbHNlaWYgKHN1YnN0cigkdXJsLCAwLCA0KSAhPT0gJ2NpZDonICYmICFwcmVnX21hdGNoKCcjXltBLXpdKzovLyMnLCAkdXJsKSkgew0KICAgICAgICAgICAgICAgICAgICAvLyBEbyBub3QgY2hhbmdlIHVybHMgZm9yIGFic29sdXRlIGltYWdlcyAodGhhbmtzIHRvIGNvcnZ1c2NvcmF4KQ0KICAgICAgICAgICAgICAgICAgICAvLyBEbyBub3QgY2hhbmdlIHVybHMgdGhhdCBhcmUgYWxyZWFkeSBpbmxpbmUgaW1hZ2VzDQogICAgICAgICAgICAgICAgICAgICRmaWxlbmFtZSA9IGJhc2VuYW1lKCR1cmwpOw0KICAgICAgICAgICAgICAgICAgICAkZGlyZWN0b3J5ID0gZGlybmFtZSgkdXJsKTsNCiAgICAgICAgICAgICAgICAgICAgaWYgKCRkaXJlY3RvcnkgPT0gJy4nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkZGlyZWN0b3J5ID0gJyc7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgJGNpZCA9IG1kNSgkdXJsKSAuICdAcGhwbWFpbGVyLjAnOyAvLyBSRkMyMzkyIFMgMg0KICAgICAgICAgICAgICAgICAgICBpZiAoc3RybGVuKCRiYXNlZGlyKSA+IDEgJiYgc3Vic3RyKCRiYXNlZGlyLCAtMSkgIT0gJy8nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAkYmFzZWRpciAuPSAnLyc7DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmxlbigkZGlyZWN0b3J5KSA+IDEgJiYgc3Vic3RyKCRkaXJlY3RvcnksIC0xKSAhPSAnLycpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICRkaXJlY3RvcnkgLj0gJy8nOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIGlmICgkdGhpcy0+YWRkRW1iZWRkZWRJbWFnZSgNCiAgICAgICAgICAgICAgICAgICAgICAgICRiYXNlZGlyIC4gJGRpcmVjdG9yeSAuICRmaWxlbmFtZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICRjaWQsDQogICAgICAgICAgICAgICAgICAgICAgICAkZmlsZW5hbWUsDQogICAgICAgICAgICAgICAgICAgICAgICAnYmFzZTY0JywNCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGY6Ol9taW1lX3R5cGVzKChzdHJpbmcpc2VsZjo6bWJfcGF0aGluZm8oJGZpbGVuYW1lLCBQQVRISU5GT19FWFRFTlNJT04pKQ0KICAgICAgICAgICAgICAgICAgICApDQogICAgICAgICAgICAgICAgICAgICkgew0KICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2UgPSBwcmVnX3JlcGxhY2UoDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJy8nIC4gJGltYWdlc1sxXVskaW1naW5kZXhdIC4gJz1bIlwnXScgLiBwcmVnX3F1b3RlKCR1cmwsICcvJykgLiAnWyJcJ10vVWknLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpbWFnZXNbMV1bJGltZ2luZGV4XSAuICc9ImNpZDonIC4gJGNpZCAuICciJywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZQ0KICAgICAgICAgICAgICAgICAgICAgICAgKTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICAkdGhpcy0+aXNIVE1MKHRydWUpOw0KICAgICAgICAvLyBDb252ZXJ0IGFsbCBtZXNzYWdlIGJvZHkgbGluZSBicmVha3MgdG8gQ1JMRiwgbWFrZXMgcXVvdGVkLXByaW50YWJsZSBlbmNvZGluZyB3b3JrIG11Y2ggYmV0dGVyDQogICAgICAgICR0aGlzLT5Cb2R5ID0gJHRoaXMtPm5vcm1hbGl6ZUJyZWFrcygkbWVzc2FnZSk7DQogICAgICAgICR0aGlzLT5BbHRCb2R5ID0gJHRoaXMtPm5vcm1hbGl6ZUJyZWFrcygkdGhpcy0+aHRtbDJ0ZXh0KCRtZXNzYWdlLCAkYWR2YW5jZWQpKTsNCiAgICAgICAgaWYgKGVtcHR5KCR0aGlzLT5BbHRCb2R5KSkgew0KICAgICAgICA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lICRhZHZhbmNlZCBBbnkgYm9vbGVhbiB2YWx1ZSB0byB1c2UgdGhlIGludGVybmFsIGNvbnZlcnRlciwNCiAgICAgKiAgIG9yIHByb3ZpZGUgeW91ciBvd24gY2FsbGFibGUgZm9yIGN1c3RvbSBjb252ZXJzaW9uLg0KICAgICAqIEByZXR1cm4gc3RyaW5nDQogICAgICovDQogICAgcHVibGljIGZ1bmN0aW9uIGh0bWwydGV4dCgkaHRtbCwgJGFkdmFuY2VkID0gZmFsc2UpDQogICAgew0KICAgICAgICBpZiAoaXNfY2FsbGFibGUoJGFkdmFuY2VkKSkgew0KICAgICAgICAgICAgcmV0dXJuIGNhbGxfdXNlcl9mdW5jKCRhZHZhbmNlZCwgJGh0bWwpOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiBodG1sX2VudGl0eV9kZWNvZGUoDQogICAgICAgICAgICB0cmltKHN0cmlwX3RhZ3MocHJlZ19yZXBsYWNlKCcvPChoZWFkfHRpdGxlfHN0eWxlfHNjcmlwdClbXj5dKj4uKj88XC9cXDE+L3NpJywgJycsICRodG1sKSkpLA0KICAgICAgICAgICAgRU5UX1FVT1RFUywNCiAgICAgICAgICAgICR0aGlzLT5DaGFyU2V0DQogICAgICAgICk7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogR2V0IHRoZSBNSU1FIHR5cGUgZm9yIGEgZmlsZSBleHRlbnNpb24uDQogICAgICogQHBhcmFtIHN0cmluZyAkZXh0IEZpbGUgZXh0ZW5zaW9uDQogICAgICogQGFjY2VzcyBwdWJsaWMNCiAgICAgKiBAcmV0dXJuIHN0cmluZyBNSU1FIHR5cGUgb2YgZmlsZS4NCiAgICAgKiBAc3RhdGljDQogICAgICovDQogICAgcHVibGljIHN0YXRpYyBmdW5jdGlvbiBfbWltZV90eXBlcygkZXh0ID0gJycpDQogICAgew0KICAgICAgICAkbWltZXMgPSBhcnJheSgNCiAgICAgICAgICAgICd4bCcgICAgPT4gJ2FwcGxpY2F0aW9uL2V4Y2VsJ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AgICAnc28nICAgID0+ICdhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0nLA0KICAgICAgICAgICAgJ29kYScgICA9PiAnYXBwbGljYXRpb24vb2RhJywNCiAgICAgICAgICAgICdwZGYnICAgPT4gJ2FwcGxpY2F0aW9uL3BkZicsDQogICAgICAgICAgICAnYWknICAgID0+ICdhcHBsaWNhdGlvbi9wb3N0c2NyaXB0JywNCiAgICAgICAgICAgICdlcHMnICAgPT4gJ2FwcGxpY2F0aW9uL3Bvc3RzY3JpcHQnLA0KICAgICAgICAgICAgJ3BzJyAgICA9PiAnYXBwbGljYXRpb24vcG9zdHNjcmlwdCcsDQogICAgICAgICAgICAnc21pJyAgID0+ICdhcHBsaWNhdGlvbi9zbWlsJywNCiAgICAgICAgICAgICdzbWlsJyAgPT4gJ2FwcGxpY2F0aW9uL3NtaWwnLA0KICAgICAgICAgICAgJ21pZicgICA9PiAnYXBwbGljYXRpb24vdm5kLm1pZicsDQogICAgICAgICAgICAneGxzJyAgID0+ICdhcHBsaWNhdGlvbi92bmQubXMtZXhjZWwnLA0KICAgICAgICAgICAgJ3BwdCcgICA9PiAnYXBwbGljYXRpb24vdm5kLm1zLXBvd2VycG9pbnQnLA0KICAgICAgICAgICAgJ3dieG1sJyA9PiAnYXBwbGljYXRpb24vdm5kLndhcC53YnhtbCcsDQogICAgICAgICAgICAnd21sYycgID0+ICdhcHBsaWNhdGlvbi92bmQud2FwLndtbGMnLA0KICAgICAgICAgICAgJ2RjcicgICA9PiAnYXBwbGljYXRpb24veC1kaXJlY3RvcicsDQogICAgICAgICAgICAnZGlyJyAgID0+ICdhcHBsaWNhdGlvbi94LWRpcmVjdG9yJywNCiAgICAgICAgICAgICdkeHInICAgPT4gJ2FwcGxpY2F0aW9uL3gtZGlyZWN0b3InLA0KICAgICAgICAgICAgJ2R2aScgICA9PiAnYXBwbGljYXRpb24veC1kdmknLA0KICAgICAgICAgICAgJ2d0YXInICA9PiAnYXBwbGljYXRpb24veC1ndGFyJywNCiAgICAgICAgICAgICdwaHAzJyAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHA0JyAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHAnICAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHRtbCcgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwJywNCiAgICAgICAgICAgICdwaHBzJyAgPT4gJ2FwcGxpY2F0aW9uL3gtaHR0cGQtcGhwLXNvdXJjZScsDQogICAgICAgICAgICAnc3dmJyAgID0+ICdhcHBsaWNhdGlvbi94LXNob2Nrd2F2ZS1mbGFzaCcsDQogICAgICAgICAgICAnc2l0JyAgID0+ICdhcHBsaWNhdGlvbi94LXN0dWZmaXQnLA0KICAgICAgICAgICAgJ3RhcicgICA9PiAnYXBwbGljYXRpb24veC10YXInLA0KICAgICAgICAgICAgJ3RneicgICA9PiAnYXBwbGljYXRpb24veC10YXInLA0KICAgICAgICAgICAgJ3hodCcgICA9PiAnYXBwbGljYXRpb24veGh0bWwreG1sJywNCiAgICAgICAgICAgICd4aHRtbCcgPT4gJ2FwcGxpY2F0aW9uL3hodG1sK3htbCcsDQogICAgICAgICAgICAnemlwJyAgID0+ICdhcHBsaWNhdGlvbi96aXAnLA0KICAgICAgICAgICAgJ21pZCcgICA9PiAnYXVkaW8vbWlkaScsDQogICAgICAgICAgICAnbWlkaScgID0+ICdhdWRpby9taWRpJywNCiAgICAgICAgICAgICdtcDInICAgPT4gJ2F1ZGlvL21wZWcnLA0KICAgICAgICAgICAgJ21wMycgICA9PiAnYXVkaW8vbXBlZycsDQogICAgICAgICAgICAnbXBnYScgID0+ICdhdWRpby9tcGVnJywNCiAgICAgICAgICAgICdhaWYnICAgPT4gJ2F1ZGlvL3gtYWlmZicsDQogICAgICAgICAgICAnYWlmYycgID0+ICdhdWRpby94LWFpZmYnLA0KICAgICAgICAgICAgJ2FpZmYnICA9PiAnYXVkaW8veC1haWZmJywNCiAgICAgICAgICAgICdyYW0nICAgPT4gJ2F1ZGlvL3gtcG4tcmVhbGF1ZGlvJywNCiAgICAgICAgICAgICdybScgICAgPT4gJ2F1ZGlvL3gtcG4tcmVhbGF1ZGlvJywNCiAgICAgICAgICAgICdycG0nICAgPT4gJ2F1ZGlvL3gtcG4tcmVhbGF1ZGlvLXBsdWdpbicsDQogICAgICAgICAgICAncmEnICAgID0+ICdhdWRpby94LXJlYWxhdWRpbycsDQogICAgICAgICAgICAnd2F2JyAgID0+ICdhdWRpby94LXdhdicsDQogICAgICAgICAgICAnYm1wJyAgID0+ICdpbWFnZS9ibXAnLA0KICAgICAgICAgICAgJ2dpZicgICA9PiAnaW1hZ2UvZ2lmJywNCiAgICAgICAgICAgICdqcGVnJyAgPT4gJ2ltYWdlL2pwZWcnLA0KICAgICAgICAgICAgJ2pwZScgICA9PiAnaW1hZ2UvanBlZycsDQogICAgICAgICAgICAnanBnJyAgID0+ICdpbWFnZS9qcGVnJywNCiAgICAgICAgICAgICdwbmcnICAgPT4gJ2ltYWdlL3BuZycsDQogICAgICAgICAgICAndGlmZicgID0+ICdpbWFnZS90aWZmJywNCiAgICAgICAgICAgICd0aWYnICAgPT4gJ2ltYWdlL3RpZmYnLA0KICAgICAgICAgICAgJ2VtbCcgICA9PiAnbWVzc2FnZS9yZmM4MjInLA0KICAgICAgICAgICAgJ2NzcycgICA9PiAndGV4dC9jc3MnLA0KICAgICAgICAgICAgJ2h0bWwnICA9PiAndGV4dC9odG1sJywNCiAgICAgICAgICAgICdodG0nICAgPT4gJ3RleHQvaHRtbCcsDQogICAgICAgICAgICAnc2h0bWwnID0+ICd0ZXh0L2h0bWwnLA0KICAgICAgICAgICAgJ2xvZycgICA9PiAndGV4dC9wbGFpbicsDQogICAgICAgICAgICAndGV4dCcgID0+ICd0ZXh0L3BsYWluJywNCiAgICAgICAgICAgICd0eHQnICAgPT4gJ3RleHQvcGxhaW4nLA0KICAgICAgICAgICAgJ3J0eCcgICA9PiAndGV4dC9yaWNodGV4dCcsDQogICAgICAgICAgICAncnRmJyAgID0+ICd0ZXh0L3J0ZicsDQogICAgICAgICAgICAndmNmJyAgID0+ICd0ZXh0L3ZjYXJkJywNCiAgICAgICAgICAgICd2Y2FyZCcgPT4gJ3RleHQvdmNhcmQnLA0KICAgICAgICAgICAgJ3htbCcgICA9PiAndGV4dC94bWwnLA0KICAgICAgICAgICAgJ3hzbCcgICA9PiAndGV4dC94bWwnLA0KICAgICAgICAgICAgJ21wZWcnICA9PiAndmlkZW8vbXBlZycsDQogICAgICAgICAgICAnbXBlJyAgID0+ICd2aWRlby9tcGVnJywNCiAgICAgICAgICAgICdtcGcnICAgPT4gJ3ZpZGVvL21wZWcnLA0KICAgICAgICAgICAgJ21vdicgICA9PiAndmlkZW8vcXVpY2t0aW1lJywNCiAgICAgICAgICAgICdxdCcgICAgPT4gJ3ZpZGVvL3F1aWNrdGltZScsDQogICAgICAgICAgICAncnYnICAgID0+ICd2aWRlby92bmQucm4tcmVhbHZpZGVvJywNCiAgICAgICAgICAgICdhdmknICAgPT4gJ3ZpZGVvL3gtbXN2aWRlbycsDQogICAgICAgICAgICAnbW92aWUnID0+ICd2aWRlby94LXNnaS1tb3ZpZScNCiAgICAgICAgKTsNCiAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoc3RydG9sb3dlcigkZXh0KSwgJG1pbWVzKSkgew0KICAgICAgICAgICAgcmV0dXJuICRtaW1lc1tzdHJ0b2xvd2VyKCRleHQpXTsNCiAgICAgICAgfQ0KICAgICAgICByZXR1cm4gJ2FwcGxpY2F0aW9uL29jdGV0LXN0cmVhbSc7DQogICAgfQ0KDQogICAgLyoqDQogICAgICogTWFwIGEgZmlsZSBuYW1lIHRvIGEgTUlNRSB0eXBlLg0KICAgICAqIERlZmF1bHRzIHRvICdhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0nLCBpLmUuL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tZSddID0gJHBhdGhpbmZvWzJdOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoNSwgJHBhdGhpbmZvKSkgew0KICAgICAgICAgICAgICAgICRyZXRbJ2V4dGVuc2lvbiddID0gJHBhdGhpbmZvWzVdOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoMywgJHBhdGhpbmZvKSkgew0KICAgICAgICAgICAgICAgICRyZXRbJ2ZpbGVuYW1lJ10gPSAkcGF0aGluZm9bM107DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgc3dpdGNoICgkb3B0aW9ucykgew0KICAgICAgICAgICAgY2FzZSBQQVRISU5GT19ESVJOQU1FOg0KICAgICAgICAgICAgY2FzZSAnZGlybmFtZSc6DQogICAgICAgICAgICAgICAgcmV0dXJuICRyZXRbJ2Rpcm5hbWUnXTsNCiAgICAgICAgICAgIGNhc2UgUEFUSElORk9fQkFTRU5BTUU6DQogICAgICAgICAgICBjYXNlICdiYXNlbmFtZSc6DQogICAgICAgICAgICAgICAgcmV0dXJuICRyZXRbJ2Jhc2VuYW1lJ107DQogICAgICAgICAgICBjYXNlIFBBVEhJTkZPX0VYVEVOU0lPTjoNCiAgICAgICAgICAgIGNhc2UgJ2V4dGVuc2lvbic6DQogICAgICAgICAgICAgICAgcmV0dXJuICRyZXRbJ2V4dGVuc2lvbiddOw0KICAgICAgICAgICAgY2FzZSBQQVRISU5GT19GSUxFTkFNRToNCiAgICAgICAgICAgIGNhc2UgJ2ZpbGVuYW1lJzoNCiAgICAgICAgICAgICAgICByZXR1cm4gJHJldFsnZmlsZW5hbWUnXTsNCiAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgcmV0dXJuICRyZXQ7DQogICAgICAgIH0NCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBTZXQgb3IgcmVzZXQgaW5zdGFuY2UgcHJvcGVydGllcy4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nOw0KICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCBzdHJsZW4oJHR4dCk7ICRpKyspIHsNCiAgICAgICAgICAgICRvcmQgPSBvcmQoJHR4dFskaV0pOw0KICAgICAgICAgICAgaWYgKCgoMHgyMSA8PSAkb3JkKSAmJiAoJG9yZCA8PSAweDNBKSkgfHwgJG9yZCA9PSAweDNDIHx8ICgoMHgzRSA8PSAkb3JkKSAmJiAoJG9yZCA8PSAweDdFKSkpIHsNCiAgICAgICAgICAgICAgICAkbGluZSAuPSAkdHh0WyRpXTsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgJGxpbmUgLj0gJz0nIC4gc3ByaW50ZignJTAyWCcsICRvcmQpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiAkbGluZTsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBHZW5lcmF0ZSBhIERLSU0gc2lnbmF0dXJlLg0KICAgICAqIEBhY2Nlc3MgcHVibGljDQogICAgICogQHBhcmFtIHN0cmluZyAkc2lnbkhlYWRlcg0KICAgICAqIEB0aHJvd3MgcGhwbWFpbGVyRXhjZXB0aW9uDQogICAgICogQHJldHVybiBzdHJpbmcNCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gREtJTV9TaWduKCRzaWduSGVhZGVyKQ0KICAgIHsNCiAgICAgICAgaWYgKCFkZWZpbmVkKCdQS0NTN19URVhUJykpIHsNCiAgICAgICAgICAgIGlmICgkdGhpcy0+ZXhjZXB0aW9ucykgew0KICAgICAgICAgICAgICAgIHRocm93IG5ldyBwaHBtYWlsZXJFeGNlcHRpb24oJHRoaXMtPmxhbmcoJ2V4dGVuc2lvbl9taXNzaW5nJykgLiAnb3BlbnNzbCcpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICB9DQogICAgICAgICRwcml2S2V5U3RyID0gZmlsZV9nZXRfY29udGVudHMoJHRoaXMtPkRLSU1fcHJpdmF0ZSk7DQogICAgICAgIGlmICgkdGhpcy0+REtJTV9wYXNzcGhyYXNlICE9ICcnKSB7DQogICAgICAgICAgICAkcHJpdktleSA9IG9wZW5zc2xfcGtleV9nZXRfcHJpdmF0ZSgkcHJpdktleVN0ciwgJHRoaXMtPkRLSU1fcGFzc3BocmFzZSk7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAkcHJpdktleSA9ICRwcml2S2V5U3RyOw0KICAgICAgICB9DQogICAgICAgIGlmIChvcGVuc3NsX3NpZ24oJHNpZ25IZWFkZXIsICRzaWduYXR1cmUsICRwcml2S2V5KSkgew0KICAgICAgICAgICAgcmV0dXJuIGJhc2U2NF9lbmNvZGUoJHNpZ25hdHVyZSk7DQogICAgICAgIH0NCiAgICAgICAgcmV0dXJuICcnOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIEdlbmVyYXRlIGEgREtJTSBjYW5vbmljYWxpemF0aW9uIGhlYWRlci4NCiAgICAgKiBAYWNjZXNzIHB1YmxpYw0KICAgICAqIEBwYXJhbSBzdHJpbmcgJHNpZ25IZWFkZXIgSGVhZGVyDQogICAgICogQHJldHVybiBzdHJpbmcNCiAgICAgKi8NCiAgICBwdWJsaWMgZnVuY3Rpb24gREtJTV9IZWFkZXJDKCRzaWduSGVhZGVyKQ0KICAgIHsNCiAgICAgICAgJHNpZ25IZWFkZXIgPSBwcmVnX3JlcGxhY2UoJy9cclxuXHMrLycsICcgJywgJHNpZ25IZWFkZXIpOw0KICAgICAgICAkbGluZXMgPSBleHBsb2RlKCJcclxuIiwgJHNpZ25IZWFkZXIpOw0KICAgICAgICBmb3JlYWNoICgkbGluZXMgYXMgJGtleSA9PiAkbGluZSkgew0KICAgICAgICAgICAgbGlzdCgkaGVhZGluZywgJHZhbHVlKSA9IGV4cGxvZGUoJzonLCAkbGluZSwgMik7DQogICAgICAgICAgICAkaGVhZGluZyA9IHN0cnRvbG93ZXIoJGhlYWRpbmcpOw0KICA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WFkZXIgPSAnJzsNCiAgICAgICAgJGN1cnJlbnQgPSAnJzsNCiAgICAgICAgZm9yZWFjaCAoJGhlYWRlcnMgYXMgJGhlYWRlcikgew0KICAgICAgICAgICAgaWYgKHN0cnBvcygkaGVhZGVyLCAnRnJvbTonKSA9PT0gMCkgew0KICAgICAgICAgICAgICAgICRmcm9tX2hlYWRlciA9ICRoZWFkZXI7DQogICAgICAgICAgICAgICAgJGN1cnJlbnQgPSAnZnJvbV9oZWFkZXInOw0KICAgICAgICAgICAgfSBlbHNlaWYgKHN0cnBvcygkaGVhZGVyLCAnVG86JykgPT09IDApIHsNCiAgICAgICAgICAgICAgICAkdG9faGVhZGVyID0gJGhlYWRlcjsNCiAgICAgICAgICAgICAgICAkY3VycmVudCA9ICd0b19oZWFkZXInOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KCQkY3VycmVudCkgJiYgc3RycG9zKCRoZWFkZXIsICcgPT8nKSA9PT0gMCkgew0KICAgICAgICAgICAgICAgICAgICAkJGN1cnJlbnQgLj0gJGhlYWRlcjsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAkY3VycmVudCA9ICcnOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICAkZnJvbSA9IHN0cl9yZXBsYWNlKCd8JywgJz03QycsICR0aGlzLT5ES0lNX1FQKCRmcm9tX2hlYWRlcikpOw0KICAgICAgICAkdG8gPSBzdHJfcmVwbGFjZSgnfCcsICc9N0MnLCAkdGhpcy0+REtJTV9RUCgkdG9faGVhZGVyKSk7DQogICAgICAgICRzdWJqZWN0ID0gc3RyX3JlcGxhY2UoDQogICAgICAgICAgICAnfCcsDQogICAgICAgICAgICAnPTdDJywNCiAgICAgICAgICAgICR0aGlzLT5ES0lNX1FQKCRzdWJqZWN0X2hlYWRlcikNCiAgICAgICAgKTsgLy8gQ29waWVkIGhlYWRlciBmaWVsZHMgKGRraW0tcXVvdGVkLXByaW50YWJsZSkNCiAgICAgICAgJGJvZHkgPSAkdGhpcy0+REtJTV9Cb2R5QygkYm9keSk7DQogICAgICAgICRES0lNbGVuID0gc3RybGVuKCRib2R5KTsgLy8gTGVuZ3RoIG9mIGJvZHkNCiAgICAgICAgJERLSU1iNjQgPSBiYXNlNjRfZW5jb2RlKHBhY2soJ0gqJywgc2hhMSgkYm9keSkpKTsgLy8gQmFzZTY0IG9mIHBhY2tlZCBiaW5hcnkgU0hBLTEgaGFzaCBvZiBib2R5DQogICAgICAgIGlmICgnJyA9PSAkdGhpcy0+REtJTV9pZGVudGl0eSkgew0KICAgICAgICAgICAgJGlkZW50ID0gJyc7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAkaWRlbnQgPSAnIGk9JyAuICR0aGlzLT5ES0lNX2lkZW50aXR5IC4gJzsnOw0KICAgICAgICB9DQogICAgICAgICRka2ltaGRycyA9ICdES0lNLVNpZ25hdHVyZTogdj0xOyBhPScgLg0KICAgICAgICAgICAgJERLSU1zaWduYXR1cmVUeXBlIC4gJzsgcT0nIC4NCiAgICAgICAgICAgICRES0lNcXVlcnkgLiAnOyBsPScgLg0KICAgICAgICAgICAgJERLSU1sZW4gLiAnOyBzPScgLg0KICAgICAgICAgICAgJHRoaXMtPkRLSU1fc2VsZWN0b3IgLg0KICAgICAgICAgICAgIjtcclxuIiAuDQogICAgICAgICAgICAiXHR0PSIgLiAkREtJTXRpbWUgLiAnOyBjPScgLiAkREtJTWNhbm9uaWNhbGl6YXRpb24gLiAiO1xyXG4iIC4NCiAgICAgICAgICAgICJcdGg9RnJvbTpUbzpTdWJqZWN0O1xyXG4iIC4NCiAgICAgICAgICAgICJcdGQ9IiAuICR0aGlzLT5ES0lNX2RvbWFpbiAuICc7JyAuICRpZGVudCAuICJcclxuIiAuDQogICAgICAgICAgICAiXHR6PSRmcm9tXHJcbiIgLg0KICAgICAgICAgICAgIlx0fCR0b1xyXG4iIC4NCiAgICAgICAgICAgICJcdHwkc3ViamVjdDtcclxuIiAuDQogICAgICAgICAgICAiXHRiaD0iIC4gJERLSU1iNjQgLiAiO1xyXG4iIC4NCiAgICAgICAgICAgICJcdGI9IjsNCiAgICAgICAgJHRvU2lnbiA9ICR0aGlzLT5ES0lNX0hlYWRlckMoDQogICAgICAgICAgICAkZnJvbV9oZWFkZXIgLiAiXHJcbiIgLg0KICAgICAgICAgICAgJHRvX2hlYWRlciAuICJcclxuIiAuDQogICAgICAgICAgICAkc3ViamVjdF9oZWFkZXIgLiAiXHJcbiIgLg0KICAgICAgICAgICAgJGRraW1oZHJzDQogICAgICAgICk7DQogICAgICAgICRzaWduZWQgPSAkdGhpcy0+REtJTV9TaWduKCR0b1NpZ24pOw0KICAgICAgICByZXR1cm4gJGRraW1oZHJzIC4gJHNpZ25lZCAuICJcclxuIjsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBEZXRlY3QgaWYgYSBzdHJpbmcgY29udGFpbnMgYSBsaW5lIGxvbmdlciB0aGFuIHRoZSBtYXhpbXVtIGxpbmUgbGVuZ3RoIGFsbG93ZWQuDQogICAgICogQHBhcmFtIHN0cmluZyAkc3RyDQogICAgICogQHJldHVybiBib29sZWFuDQogICAgICogQHN0YXRpYw0KICAgICAqLw0KICAgIHB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gaGFzTGluZUxvbmdlclRoYW5NYXgoJHN0cikNCiAgICB7DQogICAgICAgIC8vKzIgdG8gaW5jbHVkZSBDUkxGIGxpbmUgYnJlYWsgZm9yIGEgMTAwMCB0b3RhbA0KICAgICAgICByZXR1cm4gKGJvb2xlYW4pcHJlZ19tYXRjaCgnL14oLnsnLihzZWxmOjpNQVhfTElORV9MRU5HVEggKyAyKS4nLH0pL20nLCAkc3RyKTsNCiAgICB9DQoNCiAgICAvKioNCiAgICAgKiBBbGxvd3MgZm9yIHB1YmxpYyByZWFkIGFjY2VzcyB0byAndG8nIHByb3BlcnR5L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VtYWlsKTsNCiAgICAgICAgICAgICRtYWlsLT5TdWJqZWN0ID0gbGVhZkNsZWFyKCRzdWJqZWN0LCRlbWFpbCk7DQogICAgICAgICAgICAkbWFpbC0+Qm9keSA9ICBsZWFmQ2xlYXIoJG1lc3NhZ2VMZXR0ZXIsJGVtYWlsKTsNCiAgICAgICAgICAgICRtYWlsLT5DaGFyU2V0ID0gJGVuY29kZTsNCiAgICAgICAgICAgIGZvcigkaT0wOyAkaTxjb3VudCgkX0ZJTEVTWydhdHRhY2htZW50J11bJ25hbWUnXSk7ICRpKyspIHsNCiAgICAgICAgICAgICAgICBpZiAoJF9GSUxFU1snYXR0YWNobWVudCddWyd0bXBfbmFtZSddWyRpXSAhPSAiIil7DQogICAgICAgICAgICAgICAgICAgICRtYWlsLT5BZGRBdHRhY2htZW50KCRfRklMRVNbJ2F0dGFjaG1lbnQnXVsndG1wX25hbWUnXVskaV0sJF9GSUxFU1snYXR0YWNobWVudCddWyduYW1lJ11bJGldKTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGlmKCRtZXNzYWdlVHlwZT09MSl7JG1haWwtPklzSFRNTCh0cnVlKTt9DQogICAgICAgICAgICBlbHNlIHskbWFpbC0+SXNIVE1MKGZhbHNlKTt9DQogICAgICAgICAgICBpZiAoISRtYWlsLT5zZW5kKCkpIHsNCiAgICAgICAgICAgICAgICBlY2hvICc8ZGl2IGNsYXNzPSJjb2wtbGctNiI+PHNwYW4gY2xhc3M9ImxhYmVsIGxhYmVsLWRlZmF1bHQiPicuJG1haWwtPkVycm9ySW5mby4nPC9zcGFuPjwvZGl2Pic7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICBlY2hvICc8ZGl2IGNsYXNzPSJjb2wtbGctNiI+PHNwYW4gY2xhc3M9ImxhYmVsIGxhYmVsLXN1Y2Nlc3MiPk9rPC9zcGFuPjwvZGl2Pic7DQogICAgICAgIC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

Variables

None

Stats

MD5 c00e27e41ae828494b43cf12cfe25eb1
Eval Count 0
Decode Time 12974 ms